class RSpec::Matchers::BuiltIn::DynamicPredicate

@api private Provides the implementation for dynamic predicate matchers. Not intended to be inherited directly.

Public Class Methods

# File rspec-expectations/lib/rspec/matchers/built_in/has.rb, line 10
def initialize(method_name, *args, &block)
  @method_name, @args, @block = method_name, args, block
end

Public Instance Methods

@api private @return [String]

# File rspec-expectations/lib/rspec/matchers/built_in/has.rb, line 43
def description
  "#{method_description}#{args_to_sentence}"
end

@private

# File rspec-expectations/lib/rspec/matchers/built_in/has.rb, line 23
def does_not_match?(actual, &block)
  @actual = actual
  @block ||= block
  predicate_accessible? && predicate_matches?(false)
end

@api private @return [String]

# File rspec-expectations/lib/rspec/matchers/built_in/has.rb, line 31
def failure_message
  failure_message_expecting(true)
end

@api private @return [String]

# File rspec-expectations/lib/rspec/matchers/built_in/has.rb, line 37
def failure_message_when_negated
  failure_message_expecting(false)
end

@private

# File rspec-expectations/lib/rspec/matchers/built_in/has.rb, line 16
def matches?(actual, &block)
  @actual = actual
  @block ||= block
  predicate_accessible? && predicate_matches?
end