Class: Representable::XML::Binding::Attribute

Inherits:
Representable::XML::Binding show all
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

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

#evaluate_option

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



143
144
145
# File 'lib/representable/xml/binding.rb', line 143

def read(node, as)
  node[as]
end

#serialize_for(value, parent, as) ⇒ Object



147
148
149
# File 'lib/representable/xml/binding.rb', line 147

def serialize_for(value, parent, as)
  parent[as] = value.to_s
end

#write(parent, value, as) ⇒ Object



151
152
153
# File 'lib/representable/xml/binding.rb', line 151

def write(parent, value, as)
  serialize_for(value, parent, as)
end