Module: Kamakura::ClassMethods
- Defined in:
- lib/kamakura.rb
Instance Method Summary collapse
- #attribute(name, type, options = {}) ⇒ Object
- #attribute_set ⇒ Object
- #parse(attributes = {}, **options) ⇒ Object
Instance Method Details
#attribute(name, type, options = {}) ⇒ Object
6 7 8 9 10 |
# File 'lib/kamakura.rb', line 6 def attribute(name, type, = {}) attribute = Attribute.new(name, type, ) register_attribute(attribute) define_attribute_reader_method(attribute) end |
#attribute_set ⇒ Object
16 17 18 |
# File 'lib/kamakura.rb', line 16 def attribute_set @__attribute_set ||= {} end |
#parse(attributes = {}, **options) ⇒ Object
12 13 14 |
# File 'lib/kamakura.rb', line 12 def parse(attributes = {}, **) new(attributes) end |