Class: Dill::Widget::NodeFilter
- Inherits:
-
Object
- Object
- Dill::Widget::NodeFilter
- Defined in:
- lib/dill/widgets/widget/node_filter.rb
Instance Attribute Summary collapse
-
#selector ⇒ Object
readonly
Returns the value of attribute selector.
Instance Method Summary collapse
-
#initialize(*selector) ⇒ NodeFilter
constructor
A new instance of NodeFilter.
- #node(parent_widget, *args) ⇒ Object
- #nodes(parent_widget, *args) ⇒ Object
- #query(parent, *args) ⇒ Object
Constructor Details
#initialize(*selector) ⇒ NodeFilter
Returns a new instance of NodeFilter.
6 7 8 |
# File 'lib/dill/widgets/widget/node_filter.rb', line 6 def initialize(*selector) @selector = selector.flatten end |
Instance Attribute Details
#selector ⇒ Object (readonly)
Returns the value of attribute selector.
4 5 6 |
# File 'lib/dill/widgets/widget/node_filter.rb', line 4 def selector @selector end |
Instance Method Details
#node(parent_widget, *args) ⇒ Object
10 11 12 |
# File 'lib/dill/widgets/widget/node_filter.rb', line 10 def node(, *args) .root.find(*(*args)) end |
#nodes(parent_widget, *args) ⇒ Object
14 15 16 |
# File 'lib/dill/widgets/widget/node_filter.rb', line 14 def nodes(, *args) .root.all(*(*args)) end |
#query(parent, *args) ⇒ Object
18 19 20 |
# File 'lib/dill/widgets/widget/node_filter.rb', line 18 def query(parent, *args) -> { node(parent, *args) } end |