Class: Representable::JSON::ObjectBinding
- Defined in:
- lib/representable/bindings/json_bindings.rb
Overview
Represents a tag with object binding.
Instance Attribute Summary
Attributes inherited from Binding
Instance Method Summary collapse
-
#update_json(hash, value) ⇒ Object
delegate :sought_type, :to => :definition.
Methods inherited from Binding
Constructor Details
This class inherits a constructor from Representable::JSON::Binding
Instance Method Details
#update_json(hash, value) ⇒ Object
delegate :sought_type, :to => :definition
48 49 50 51 52 53 54 |
# File 'lib/representable/bindings/json_bindings.rb', line 48 def update_json(hash, value) if definition.array? hash.merge! ({definition.from => value.collect {|v| v.to_hash(:wrap => false)}}) # hier name=> wech. else hash.merge! value.to_hash end end |