Module: Representable::HashMethods
- Included in:
- XML::AttributeHash, XML::Hash
- Defined in:
- lib/representable/hash_methods.rb
Instance Method Summary collapse
- #create_representation_with(doc, options, format) ⇒ Object
- #update_properties_from(doc, options, format) ⇒ Object
Instance Method Details
#create_representation_with(doc, options, format) ⇒ Object
3 4 5 6 7 |
# File 'lib/representable/hash_methods.rb', line 3 def create_representation_with(doc, , format) bin = representable_mapper(format, ).bindings.first hash = filter_keys_for(represented, ) bin.render_fragment(hash, doc) # TODO: Use something along Populator, which does end |
#update_properties_from(doc, options, format) ⇒ Object
9 10 11 12 13 14 15 16 |
# File 'lib/representable/hash_methods.rb', line 9 def update_properties_from(doc, , format) bin = representable_mapper(format, ).bindings.first hash = filter_keys_for(doc, ) value = Deserializer::Hash.new(bin).call(hash) # value = bin.deserialize_from(hash) represented.replace(value) end |