Class: YTools::Path::DescendantSelector
- Defined in:
- lib/ytools/path/selectors.rb
Instance Attribute Summary collapse
-
#match ⇒ Object
readonly
Returns the value of attribute match.
Attributes inherited from Selector
Instance Method Summary collapse
-
#initialize(match) ⇒ DescendantSelector
constructor
A new instance of DescendantSelector.
- #select(element) ⇒ Object
Methods inherited from Selector
Constructor Details
#initialize(match) ⇒ DescendantSelector
Returns a new instance of DescendantSelector.
84 85 86 |
# File 'lib/ytools/path/selectors.rb', line 84 def initialize(match) @match = match end |
Instance Attribute Details
#match ⇒ Object (readonly)
Returns the value of attribute match.
82 83 84 |
# File 'lib/ytools/path/selectors.rb', line 82 def match @match end |
Instance Method Details
#select(element) ⇒ Object
88 89 90 91 92 93 94 95 96 |
# File 'lib/ytools/path/selectors.rb', line 88 def select(element) results = [] element_select(element, results) if results.length == 1 results[0] else results end end |