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 8 |
# File 'lib/representable/hash_methods.rb', line 3 def create_representation_with(doc, , format) hash = filter_keys_for!(represented, ) # FIXME: this modifies options and replicates logic from Representable. bin = representable_map(, format).first Collect::Hash[*bin.default_render_fragment_functions].(hash, {doc: doc, options: , binding: bin, represented: represented, decorator: self}) end |
#update_properties_from(doc, options, format) ⇒ Object
10 11 12 13 14 15 16 17 |
# File 'lib/representable/hash_methods.rb', line 10 def update_properties_from(doc, , format) hash = filter_keys_for!(doc, ) bin = representable_map(, format).first value = Collect::Hash[*bin.default_parse_fragment_functions].(hash, fragment: hash, document: doc, binding: bin, represented: represented, options: , decorator: self) represented.replace(value) end |