Class: Representable::XML::Binding::Content

Inherits:
Representable::XML::Binding show all
Defined in:
lib/representable/xml/binding.rb

Overview

Represents tag content.

Instance Attribute Summary

Attributes inherited from Binding

#represented, #user_options

Instance Method Summary collapse

Methods inherited from Representable::XML::Binding

build_for, #deserialize_from, #deserialize_method, #serialize_method, #serialize_node

Methods inherited from Binding

#[], #array?, #as, build, #compile_fragment, #default_for, #evaluate_option, #get, #getter, #has_default?, #initialize, #name, #parse_filter, #read_fragment, #render_filter, #render_fragment, #representable?, #representer_module, #representer_module_for, #set, #setter, #skipable_empty_value?, #typed?, #uncompile_fragment, #write_fragment

Constructor Details

This class inherits a constructor from Representable::Binding

Instance Method Details

#read(node) ⇒ Object


157
158
159
# File 'lib/representable/xml/binding.rb', line 157

def read(node)
  node.content
end

#serialize_for(value, parent) ⇒ Object


161
162
163
# File 'lib/representable/xml/binding.rb', line 161

def serialize_for(value, parent)
  parent.content = value.to_s
end

#write(parent, value) ⇒ Object


165
166
167
# File 'lib/representable/xml/binding.rb', line 165

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