Sha256: ad22a4fb2401bb788f2f7cde7025e79f23ce90defb30d1c6c7ca0e2d02f83a20

Contents?: true

Size: 620 Bytes

Versions: 8

Compression:

Stored size: 620 Bytes

Contents

# frozen_string_literal: true

require 'capybara/selector/filters/base'

module Capybara
  class Selector
    module Filters
      class ExpressionFilter < Base
        def apply_filter(expr, value)
          return expr if skip?(value)
          raise "ArgumentError", "Invalid value #{value.inspect} passed to expression filter #{@name}" unless valid_value?(value)
          @block.call(expr, value)
        end
      end

      class IdentityExpressionFilter < ExpressionFilter
        def initialize; end
        def default?; false; end
        def apply_filter(expr, _value); expr; end
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
capybara-3.1.1 lib/capybara/selector/filters/expression_filter.rb
capybara-3.1.0 lib/capybara/selector/filters/expression_filter.rb
capybara-3.0.3 lib/capybara/selector/filters/expression_filter.rb
capybara-3.0.2 lib/capybara/selector/filters/expression_filter.rb
capybara-3.0.1 lib/capybara/selector/filters/expression_filter.rb
capybara-3.0.0 lib/capybara/selector/filters/expression_filter.rb
capybara-3.0.0.rc2 lib/capybara/selector/filters/expression_filter.rb
capybara-3.0.0.rc1 lib/capybara/selector/filters/expression_filter.rb