Class: Dill::Widget::NodeFilter

Inherits:
Object
  • Object
show all
Defined in:
lib/dill/widgets/widget/node_filter.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#selectorObject (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(parent_widget, *args)
  parent_widget.root.find(*capybara_selector(*args))
end

#nodes(parent_widget, *args) ⇒ Object



14
15
16
# File 'lib/dill/widgets/widget/node_filter.rb', line 14

def nodes(parent_widget, *args)
  parent_widget.root.all(*capybara_selector(*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