Module: Extant::Attributes::ClassMethods

Defined in:
lib/extant/attributes.rb

Instance Method Summary collapse

Instance Method Details

#attribute(name, type = nil, **opts) ⇒ Object



15
16
17
18
# File 'lib/extant/attributes.rb', line 15

def attribute(name, type=nil, **opts)
  opts[:type] = type
  attribute_definitions[name] = AttributeDefinition.new(self, name, opts)
end

#attribute_definitionsObject



11
12
13
# File 'lib/extant/attributes.rb', line 11

def attribute_definitions
  @attributes ||= {}
end