Class: Momo::Mapping

Inherits:
MomoScope show all
Defined in:
lib/momo/mapping.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from MomoScope

#call, #lookup, #ref

Constructor Details

#initialize(&block) ⇒ Mapping

Returns a new instance of Mapping.



20
21
22
23
# File 'lib/momo/mapping.rb', line 20

def initialize(&block)
	@major_keys = {}
	instance_eval(&block)
end

Instance Attribute Details

#major_keysObject

Returns the value of attribute major_keys.



18
19
20
# File 'lib/momo/mapping.rb', line 18

def major_keys
  @major_keys
end

Instance Method Details

#key(name, &block) ⇒ Object



25
26
27
# File 'lib/momo/mapping.rb', line 25

def key(name, &block)
	@major_keys[name] = MappingRow.new(&block).values
end