Class: Arrays::HashVariable

Inherits:
Object
  • Object
show all
Defined in:
lib/liquid-arrays/hash_variable.rb

Instance Method Summary collapse

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