class XML::Mapping::ObjectNode

Node factory function synopsis:

object_node :_attrname_, _path_ [, :default_value=>_obj_]
                                [, :optional=>true]
                                [, :class=>_c_]
                                [, :marshaller=>_proc_]
                                [, :unmarshaller=>_proc_]
                                [, :mapping=>_m_]
                                [, :sub_mapping=>_sm_]

Node that maps a subtree in the source XML to a Ruby object. :attrname and path are again the attribute name resp. XPath expression of the mapped attribute; the keyword arguments :default_value and :optional are handled by the SingleAttributeNode superclass. The XML subnode named by path is mapped to the attribute named by :attrname according to the keyword arguments :class, :marshaller, and :unmarshaller, which are handled by the SubObjectBaseNode superclass.

Public Class Methods

new(*args) click to toggle source

Initializer. path (a string denoting an XPath expression) is the location of the subtree.

Calls superclass method XML::Mapping::SubObjectBaseNode.new
# File lib/xml/mapping/standard_nodes.rb, line 167
def initialize(*args)
  path,*args = super(*args)
  @path = XML::XXPath.new(path)
  args
end