Class: Capybara::Selector::Filter

Inherits:
Object
  • Object
show all
Defined in:
lib/capybara/selector.rb

Instance Method Summary (collapse)

Constructor Details

- (Filter) initialize(name, block, options = {})

Returns a new instance of Filter



4
5
6
7
8
# File 'lib/capybara/selector.rb', line 4

def initialize(name, block, options={})
  @name = name
  @block = block
  @options = options
end

Instance Method Details

- (Object) default



14
15
16
# File 'lib/capybara/selector.rb', line 14

def default
  @options[:default]
end

- (Boolean) default?

Returns:

  • (Boolean)


10
11
12
# File 'lib/capybara/selector.rb', line 10

def default?
  @options.has_key?(:default)
end

- (Boolean) matches?(node, value)

Returns:

  • (Boolean)


18
19
20
# File 'lib/capybara/selector.rb', line 18

def matches?(node, value)
  @block.call(node, value)
end