Module: Structural::Model::Descriptor
- Defined in:
- lib/structural/model/descriptor.rb
Instance Method Summary collapse
- #field(f, options = {}) ⇒ Object
- #has_many(f, options = {}) ⇒ Object
- #has_one(f, options = {}) ⇒ Object
- #to_proc ⇒ Object
Instance Method Details
#field(f, options = {}) ⇒ Object
4 5 6 |
# File 'lib/structural/model/descriptor.rb', line 4 def field(f, ={}) Field.new(self, f, ).define end |
#has_many(f, options = {}) ⇒ Object
12 13 14 |
# File 'lib/structural/model/descriptor.rb', line 12 def has_many(f, ={}) HasMany.new(self, f, ).define end |
#has_one(f, options = {}) ⇒ Object
8 9 10 |
# File 'lib/structural/model/descriptor.rb', line 8 def has_one(f, ={}) HasOne.new(self, f, ).define end |
#to_proc ⇒ Object
16 17 18 |
# File 'lib/structural/model/descriptor.rb', line 16 def to_proc lambda { |data| new data } end |