class XML::Mapping::BooleanNode

Node factory function synopsis:

boolean_node :_attrname_, _path_,
             _true_value_, _false_value_ [, :default_value=>_obj_]
                                         [, :optional=>true]
                                         [, :mapping=>_m_]

Node that maps an XML node's text (the element name resp. the attribute value) to a boolean attribute of the mapped object. The attribute named by :attrname is mapped to/from the XML subnode named by the XPath expression path. true_value is the text the node must have in order to represent the true boolean value, false_value (actually, any value other than true_value) is the text the node must have in order to represent the false boolean value.

Public Class Methods

new(*args) click to toggle source

Initializer.

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