Class: Arrays::HashVariable
- Inherits:
-
Object
- Object
- Arrays::HashVariable
- Defined in:
- lib/liquid-arrays/hash_variable.rb
Instance Method Summary collapse
-
#initialize(hash) ⇒ HashVariable
constructor
A new instance of HashVariable.
- #render(context) ⇒ Object
Constructor Details
#initialize(hash) ⇒ HashVariable
Returns a new instance of HashVariable.
3 4 5 |
# File 'lib/liquid-arrays/hash_variable.rb', line 3 def initialize(hash) @hash = hash end |
Instance Method Details
#render(context) ⇒ Object
7 8 9 |
# File 'lib/liquid-arrays/hash_variable.rb', line 7 def render(context) @hash.map { |k,v| [k.render(context), v.render(context)] }.to_h end |