Class: Capybara::Selector::Filter

### Home Classes Methods

### In Files

- lib/capybara/selector.rb

### Parent

Object

### Methods

- ::new
- #default
- #default?
- #matches?

### Files

- another_test_file.txt
- test_file.txt

### Class/Module Index

Quicksearch

- Capybara
- Capybara::Ambiguous
- Capybara::CapybaraError
- Capybara::DSL
- Capybara::Driver
- Capybara::Driver::Base
- Capybara::Driver::Node
- Capybara::DriverNotFoundError
- Capybara::ElementNotFound
- Capybara::ExpectationNotMet
- Capybara::Features
- Capybara::FileNotFound
- Capybara::FrozenInTime
- Capybara::Helpers
- Capybara::InfiniteRedirectError
- Capybara::ModalNotFound
- Capybara::Node
- Capybara::Node::Actions
- Capybara::Node::Base
- Capybara::Node::Document
- Capybara::Node::DocumentMatchers
- Capybara::Node::Element
- Capybara::Node::Finders
- Capybara::Node::Matchers
- Capybara::Node::Simple
- Capybara::NotSupportedByDriverError
- Capybara::Queries
- Capybara::Queries::BaseQuery
- Capybara::Queries::TextQuery
- Capybara::Queries::TitleQuery
- Capybara::Query
- Capybara::RSpecMatchers
- Capybara::RSpecMatchers::BecomeClosed
- Capybara::RSpecMatchers::HaveSelector
- Capybara::RSpecMatchers::HaveText
- Capybara::RSpecMatchers::HaveTitle
- Capybara::RSpecMatchers::Matcher
- Capybara::RackTest
- Capybara::RackTest::Browser
- Capybara::RackTest::CSSHandlers
- Capybara::RackTest::Driver
- Capybara::RackTest::Form
- Capybara::RackTest::Form::NilUploadedFile
- Capybara::RackTest::Node
- Capybara::ReadOnlyElementError
- Capybara::Result
- Capybara::ScopeError
- Capybara::Selector
- Capybara::Selector::Filter
- Capybara::Selenium
- Capybara::Selenium::Driver
- Capybara::Selenium::Node
- Capybara::Server
- Capybara::Server::Middleware
- Capybara::Session
- Capybara::SpecHelper
- Capybara::UnselectNotAllowed
- Capybara::Window
- Capybara::WindowError
- TestApp
- TestApp::TestAppError
- Object

No matching classes.

# Capybara::Selector::Filter

### Public Class Methods

new(name, block, options={}) click to toggle source

    # File lib/capybara/selector.rb, line 4
    def initialize(name, block, options={})
      @name = name
      @block = block
      @options = options
      @options[:valid_values] = [true,false] if options[:boolean]
    end

### Public Instance Methods

default() click to toggle source

    # File lib/capybara/selector.rb, line 15
    def default
      @options[:default]
    end

default?() click to toggle source

    # File lib/capybara/selector.rb, line 11
    def default?
      @options.has_key?(:default)
    end

matches?(node, value) click to toggle source

    # File lib/capybara/selector.rb, line 19
    def matches?(node, value)
      if @options.has_key?(:valid_values) && !Array(@options[:valid_values]).include?(value)
        warn "Invalid value #{value.inspect} passed to filter #{@name}"
      end
      @block.call(node, value)
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.