Class: Representable::XML::AttributeBinding
- Inherits:
-
PropertyBinding
- Object
- SimpleDelegator
- Binding
- PropertyBinding
- Representable::XML::AttributeBinding
- Defined in:
- lib/representable/bindings/xml_bindings.rb
Overview
Represents a tag attribute. Currently this only works on the top-level tag.
Instance Attribute Summary
Attributes inherited from Binding
#lambda_context, #represented, #user_options
Instance Method Summary collapse
Methods inherited from PropertyBinding
build_for, #deserialize_from, #deserialize_node, #initialize, #serialize_node
Methods inherited from Binding
build, #compile_fragment, #definition, #deserialize, #get, #initialize, #read_fragment, #read_fragment_for, #serialize, #set, #uncompile_fragment, #write_fragment, #write_fragment_for
Constructor Details
This class inherits a constructor from Representable::XML::PropertyBinding
Instance Method Details
#read(node) ⇒ Object
151 152 153 |
# File 'lib/representable/bindings/xml_bindings.rb', line 151 def read(node) deserialize(node[from]) end |
#serialize_for(value, parent) ⇒ Object
155 156 157 |
# File 'lib/representable/bindings/xml_bindings.rb', line 155 def serialize_for(value, parent) parent[from] = serialize(value.to_s) end |
#write(parent, value) ⇒ Object
159 160 161 |
# File 'lib/representable/bindings/xml_bindings.rb', line 159 def write(parent, value) serialize_for(value, parent) end |