Class: DiviningRod::Mappings

Inherits:
Object
  • Object
show all
Defined in:
lib/divining_rod/mappings.rb

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.root_definitionObject

Returns the value of attribute root_definition.



6
7
8
# File 'lib/divining_rod/mappings.rb', line 6

def root_definition
  @root_definition
end

Class Method Details

.define(opts = {}) {|Mapper.new(@root_definition, opts)| ... } ⇒ Object

Yields:



8
9
10
11
12
# File 'lib/divining_rod/mappings.rb', line 8

def define(opts = {})
  @root_definition = Definition.new { true }
  yield Mapper.new(@root_definition, opts)
  @root_definition.freeze
end

.evaluate(obj) ⇒ Object



14
15
16
# File 'lib/divining_rod/mappings.rb', line 14

def evaluate(obj)
  @root_definition.evaluate(obj)
end