Class: AffirmIt::Preference::Matches
- Inherits:
-
Preference
- Object
- Preference
- AffirmIt::Preference::Matches
- Defined in:
- lib/affirmit/preference/matches.rb
Instance Method Summary collapse
- #description ⇒ Object
-
#initialize(expected) ⇒ Matches
constructor
A new instance of Matches.
- #is_preferred?(actual) ⇒ Boolean
Methods inherited from Preference
Constructor Details
#initialize(expected) ⇒ Matches
Returns a new instance of Matches.
6 7 8 |
# File 'lib/affirmit/preference/matches.rb', line 6 def initialize expected @expected = expected end |
Instance Method Details
#description ⇒ Object
14 15 16 |
# File 'lib/affirmit/preference/matches.rb', line 14 def description return "a match for <#{@expected.inspect}>" end |
#is_preferred?(actual) ⇒ Boolean
10 11 12 |
# File 'lib/affirmit/preference/matches.rb', line 10 def is_preferred? actual actual =~ @expected end |