Class: HashTemplate
- Inherits:
-
Object
- Object
- HashTemplate
- Defined in:
- lib/hash_template.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
-
#mapping ⇒ Object
readonly
Returns the value of attribute mapping.
Instance Method Summary collapse
-
#initialize(mapping) ⇒ HashTemplate
constructor
A new instance of HashTemplate.
- #map(data) ⇒ Object
Constructor Details
#initialize(mapping) ⇒ HashTemplate
Returns a new instance of HashTemplate.
4 5 6 |
# File 'lib/hash_template.rb', line 4 def initialize(mapping) @mapping = mapping end |
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
2 3 4 |
# File 'lib/hash_template.rb', line 2 def data @data end |
#mapping ⇒ Object (readonly)
Returns the value of attribute mapping.
2 3 4 |
# File 'lib/hash_template.rb', line 2 def mapping @mapping end |
Instance Method Details
#map(data) ⇒ Object
8 9 10 11 |
# File 'lib/hash_template.rb', line 8 def map(data) @data = data deep_map mapping end |