Class: Hash

Inherits:
Object show all
Defined in:
lib/handlebarer/serialize.rb

Instance Method Summary collapse

Instance Method Details

#to_hbsObject

Serialize Hash to Handlebarer format. Invoke ‘to_hbs` on members



100
101
102
103
104
105
106
# File 'lib/handlebarer/serialize.rb', line 100

def to_hbs
  res = {}
  each_pair do |key, value|
    res[key] = (value.respond_to?(:to_hbs) ? value.to_hbs : value)
  end
  res
end