Class: Handsoap::XmlQueryFront::NodeSelection

Inherits:
Array
  • Object
show all
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)

Instance Method Details

- (Object) /(expression)



104
105
106
# File 'lib/handsoap/xml_query_front.rb', line 104

def /(expression)
  self.first.xpath(expression)
end

- (Object) node_name



95
96
97
# File 'lib/handsoap/xml_query_front.rb', line 95

def node_name
  self.first.node_name if self.any?
end

- (Object) node_namespace



98
99
100
# File 'lib/handsoap/xml_query_front.rb', line 98

def node_namespace
  self.first.node_namespace if self.any?
end

- (Object) to_big_decimal(decimal_places = 2)



89
90
91
# File 'lib/handsoap/xml_query_front.rb', line 89

def to_big_decimal(decimal_places = 2)
  self.first.to_big_decimal(decimal_places) if self.any?
end

- (Object) to_boolean



83
84
85
# File 'lib/handsoap/xml_query_front.rb', line 83

def to_boolean
  self.first.to_boolean if self.any?
end

- (Object) to_date



86
87
88
# File 'lib/handsoap/xml_query_front.rb', line 86

def to_date
  self.first.to_date if self.any?
end

- (Object) to_f



80
81
82
# File 'lib/handsoap/xml_query_front.rb', line 80

def to_f
  self.first.to_f if self.any?
end

- (Object) to_i



77
78
79
# File 'lib/handsoap/xml_query_front.rb', line 77

def to_i
  self.first.to_i if self.any?
end

- (Object) to_raw



110
111
112
# File 'lib/handsoap/xml_query_front.rb', line 110

def to_raw
  self.first.to_raw if self.any?
end

- (Object) to_s



92
93
94
# File 'lib/handsoap/xml_query_front.rb', line 92

def to_s
  self.first.to_s if self.any?
end

- (Object) to_xml



107
108
109
# File 'lib/handsoap/xml_query_front.rb', line 107

def to_xml
  self.first.to_xml if self.any?
end

- (Object) xpath(expression, ns = nil)



101
102
103
# File 'lib/handsoap/xml_query_front.rb', line 101

def xpath(expression, ns = nil)
  self.first.xpath(expression, ns)
end