Method: Representable::Hash#to_hash

Defined in:
lib/representable/hash.rb

#to_hash(options = {}, binding_builder = Binding) ⇒ Object Also known as: render



33
34
35
36
37
38
39
40
# File 'lib/representable/hash.rb', line 33

def to_hash(options={}, binding_builder=Binding)
  hash = create_representation_with({}, options, binding_builder)

  return hash if options[:wrap] == false
  return hash unless wrap = options[:wrap] || representation_wrap(options)

  {wrap => hash}
end