Getting started: attributes.

Super super basic collection of attributes. Nothing fancy.
This commit is contained in:
Steve Klabnik
2014-07-09 16:16:39 -04:00
parent a45b5eeda3
commit 729a823868
9 changed files with 68 additions and 13 deletions

View File

@@ -0,0 +1,21 @@
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

View File

@@ -0,0 +1,5 @@
module ActiveModel
class Serializer
VERSION = "0.9.0"
end
end