active_model_serializers/lib/active_model/serializer.rb
Steve Klabnik 729a823868 Getting started: attributes.
Super super basic collection of attributes. Nothing fancy.
2014-07-09 16:16:39 -04:00

22 lines
332 B
Ruby

module ActiveModel
class Serializer
class << self
attr_accessor :_attributes
end
def self.inherited(base)
base._attributes = []
end
def self.attributes(*attrs)
@_attributes.concat attrs
end
attr_accessor :object
def initialize(object)
@object = object
end
end
end