Class: Handsoap::XmlQueryFront::NodeSelection
- Inherits:
-
Array
- Object
- Array
- Handsoap::XmlQueryFront::NodeSelection
- Defined in:
- lib/handsoap/xml_query_front.rb
Overview
NodeSelection is a wrapper around Array, that implicitly delegates XmlElement methods to the first element.
It makes mapping code prettier, since you often need to access the first element of a selection.
Instance Method Summary collapse
- #/(expression) ⇒ Object
- #node_name ⇒ Object
- #to_boolean ⇒ Object
- #to_date ⇒ Object
- #to_f ⇒ Object
- #to_i ⇒ Object
- #to_raw ⇒ Object
- #to_s ⇒ Object
- #to_xml ⇒ Object
- #xpath(expression, ns = nil) ⇒ Object
Instance Method Details
#/(expression) ⇒ Object
94 95 96 |
# File 'lib/handsoap/xml_query_front.rb', line 94 def /(expression) self.first.xpath(expression) end |
#node_name ⇒ Object
88 89 90 |
# File 'lib/handsoap/xml_query_front.rb', line 88 def node_name self.first.node_name if self.any? end |
#to_boolean ⇒ Object
79 80 81 |
# File 'lib/handsoap/xml_query_front.rb', line 79 def to_boolean self.first.to_boolean if self.any? end |
#to_date ⇒ Object
82 83 84 |
# File 'lib/handsoap/xml_query_front.rb', line 82 def to_date self.first.to_date if self.any? end |
#to_f ⇒ Object
76 77 78 |
# File 'lib/handsoap/xml_query_front.rb', line 76 def to_f self.first.to_f if self.any? end |
#to_i ⇒ Object
73 74 75 |
# File 'lib/handsoap/xml_query_front.rb', line 73 def to_i self.first.to_i if self.any? end |
#to_raw ⇒ Object
100 101 102 |
# File 'lib/handsoap/xml_query_front.rb', line 100 def to_raw self.first.to_raw if self.any? end |
#to_s ⇒ Object
85 86 87 |
# File 'lib/handsoap/xml_query_front.rb', line 85 def to_s self.first.to_s if self.any? end |
#to_xml ⇒ Object
97 98 99 |
# File 'lib/handsoap/xml_query_front.rb', line 97 def to_xml self.first.to_xml if self.any? end |
#xpath(expression, ns = nil) ⇒ Object
91 92 93 |
# File 'lib/handsoap/xml_query_front.rb', line 91 def xpath(expression, ns = nil) self.first.xpath(expression, ns) end |