Class: Representable::XML::Binding::Attribute
- Inherits:
-
Representable::XML::Binding
- Object
- Binding
- Representable::XML::Binding
- Representable::XML::Binding::Attribute
- Defined in:
- lib/representable/xml/binding.rb
Overview
Represents a tag attribute. Currently this only works on the top-level tag.
Instance Attribute Summary
Attributes inherited from Binding
#cached_representer, #getter, #name, #setter
Instance Method Summary collapse
- #read(node, as) ⇒ Object
- #serialize_for(value, parent, as) ⇒ Object
- #write(parent, value, as) ⇒ Object
Methods inherited from Representable::XML::Binding
build_for, #deserialize_from, #deserialize_method, #serialize_method, #serialize_node
Methods inherited from Binding
#[], build, #default_for, #initialize, #skipable_empty_value?
Methods included from Binding::Factories
#collect_for, #default_parse_fragment_functions, #default_parse_init_functions, #default_post_functions, #default_render_fragment_functions, #default_render_init_functions, #parse_functions, #pipeline_for, #render_functions
Methods included from Binding::EvaluateOption
Methods included from Binding::Deprecatable
#compile_fragment, #uncompile_fragment
Constructor Details
This class inherits a constructor from Representable::Binding
Instance Method Details
#read(node, as) ⇒ Object
142 143 144 |
# File 'lib/representable/xml/binding.rb', line 142 def read(node, as) node[as] end |
#serialize_for(value, parent, as) ⇒ Object
146 147 148 |
# File 'lib/representable/xml/binding.rb', line 146 def serialize_for(value, parent, as) parent[as] = value.to_s end |
#write(parent, value, as) ⇒ Object
150 151 152 |
# File 'lib/representable/xml/binding.rb', line 150 def write(parent, value, as) serialize_for(value, parent, as) end |