Class: Mutant::Predicate::Attribute::Regexp

Inherits:
Mutant::Predicate::Attribute show all
Defined in:
lib/mutant/predicate/attribute.rb

Overview

Regexp based attribute predicate

Instance Method Summary collapse

Methods inherited from Mutant::Predicate

handle

Instance Method Details

#match?(object) ⇒ true, false

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Test for match

Parameters:

  • object (Object)

Returns:

  • (true)

    if attribute value matches expectation

  • (false)

    otherwise



38
39
40
# File 'lib/mutant/predicate/attribute.rb', line 38

def match?(object)
  !!(expectation =~ value(object))
end