Class: Momo::Mapping
Instance Attribute Summary collapse
-
#major_keys ⇒ Object
Returns the value of attribute major_keys.
Instance Method Summary collapse
-
#initialize(&block) ⇒ Mapping
constructor
A new instance of Mapping.
- #key(name, &block) ⇒ Object
Methods inherited from MomoScope
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_keys ⇒ Object
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 |