Method: Modis::Attribute::ClassMethods#bootstrap_attributes

Defined in:
lib/modis/attribute.rb

#bootstrap_attributes(parent = nil) ⇒ Object



21
22
23
24
25
26
27
28
29
30
# File 'lib/modis/attribute.rb', line 21

def bootstrap_attributes(parent = nil)
  class << self
    attr_accessor :attributes, :attributes_with_defaults
  end

  self.attributes = parent ? parent.attributes.dup : {}
  self.attributes_with_defaults = parent ? parent.attributes_with_defaults.dup : {}

  attribute :id, :integer unless parent
end