Class: XmlMapper::TextNode

Inherits:
Item
  • Object
show all
Defined in:
lib/xmlmapper/text_node.rb

Instance Attribute Summary

Attributes inherited from Item

#name, #namespace, #options, #tag, #type

Instance Method Summary collapse

Methods inherited from Item

#constant, #from_xml_node, #initialize, #method_name, #typecast, #xpath

Constructor Details

This class inherits a constructor from XmlMapper::Item

Instance Method Details

#find(node, namespace, xpath_options) ⇒ Object



4
5
6
7
8
9
10
# File 'lib/xmlmapper/text_node.rb', line 4

def find(node, namespace, xpath_options)
  if node.children.any? {|c| c.text?}
    yield(node)
  else
    yield(nil)
  end
end