Class: Peanuts::Mappings::WrapperElement

Inherits:
Element show all
Defined in:
lib/peanuts/mappings.rb

Instance Attribute Summary

Attributes inherited from MemberMapping

#converter, #name, #type

Attributes inherited from Peanuts::Mapping

#local_name, #namespace_uri, #options, #prefix

Instance Method Summary collapse

Methods inherited from MemberMapping

#initialize

Methods inherited from Peanuts::Mapping

#initialize, #matches?, node_type

Constructor Details

This class inherits a constructor from Peanuts::Mappings::MemberMapping

Instance Method Details

#clear(nut) ⇒ Object



229
230
231
# File 'lib/peanuts/mappings.rb', line 229

def clear(nut)
  type.mapper.clear(nut)
end

#define_accessors(type) ⇒ Object



233
234
235
# File 'lib/peanuts/mappings.rb', line 233

def define_accessors(type)
  Mapper.of(self.type).define_accessors(type)
end

#read(nut, reader) ⇒ Object



221
222
223
# File 'lib/peanuts/mappings.rb', line 221

def read(nut, reader)
  Mapper.of(type).read(nut, reader)
end

#write(nut, writer) ⇒ Object



225
226
227
# File 'lib/peanuts/mappings.rb', line 225

def write(nut, writer)
  write_node(writer) {|w| Mapper.of(type).write_children(nut, w) }
end