Module: Id::Model::Descriptor
- Defined in:
- lib/id/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
5 6 7 |
# File 'lib/id/model/descriptor.rb', line 5 def field(f, ={}) Field.new(self, f, ).define end |
#has_many(f, options = {}) ⇒ Object
13 14 15 |
# File 'lib/id/model/descriptor.rb', line 13 def has_many(f, ={}) HasMany.new(self, f, ).define end |
#has_one(f, options = {}) ⇒ Object
9 10 11 |
# File 'lib/id/model/descriptor.rb', line 9 def has_one(f, ={}) HasOne.new(self, f, ).define end |
#to_proc ⇒ Object
17 18 19 |
# File 'lib/id/model/descriptor.rb', line 17 def to_proc lambda { |data| new data } end |