Class: XPath::Union
Instance Attribute Summary collapse
-
#expressions ⇒ Object
(also: #arguments)
readonly
Returns the value of attribute expressions.
Instance Method Summary collapse
- #each(&block) ⇒ Object
- #expression ⇒ Object
-
#initialize(*expressions) ⇒ Union
constructor
A new instance of Union.
-
#method_missing(*args) ⇒ Object
rubocop:disable Style/MethodMissingSuper, Style/MissingRespondToMissing.
- #to_xpath(type = nil) ⇒ Object (also: #to_s)
Constructor Details
#initialize(*expressions) ⇒ Union
Returns a new instance of Union.
10 11 12 |
# File 'lib/xpath/union.rb', line 10 def initialize(*expressions) @expressions = expressions end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(*args) ⇒ Object
rubocop:disable Style/MethodMissingSuper, Style/MissingRespondToMissing
22 23 24 |
# File 'lib/xpath/union.rb', line 22 def method_missing(*args) # rubocop:disable Style/MethodMissingSuper, Style/MissingRespondToMissing XPath::Union.new(*arguments.map { |e| e.send(*args) }) end |
Instance Attribute Details
#expressions ⇒ Object (readonly) Also known as: arguments
Returns the value of attribute expressions.
7 8 9 |
# File 'lib/xpath/union.rb', line 7 def expressions @expressions end |
Instance Method Details
#each(&block) ⇒ Object
18 19 20 |
# File 'lib/xpath/union.rb', line 18 def each(&block) arguments.each(&block) end |
#expression ⇒ Object
14 15 16 |
# File 'lib/xpath/union.rb', line 14 def expression :union end |