Module: Structural::Model::Descriptor

Defined in:
lib/structural/model/descriptor.rb

Instance Method Summary collapse

Instance Method Details

#field(f, options = {}) ⇒ Object



4
5
6
# File 'lib/structural/model/descriptor.rb', line 4

def field(f, options={})
  Field.new(self, f, options).define
end

#has_many(f, options = {}) ⇒ Object



12
13
14
# File 'lib/structural/model/descriptor.rb', line 12

def has_many(f, options={})
  HasMany.new(self, f, options).define
end

#has_one(f, options = {}) ⇒ Object



8
9
10
# File 'lib/structural/model/descriptor.rb', line 8

def has_one(f, options={})
  HasOne.new(self, f, options).define
end

#to_procObject



16
17
18
# File 'lib/structural/model/descriptor.rb', line 16

def to_proc
  lambda { |data| new data }
end