Class: AffirmIt::Preference::Preference
- Inherits:
-
Object
- Object
- AffirmIt::Preference::Preference
- Defined in:
- lib/affirmit/preference/preference.rb,
lib/affirmit/preferences.rb
Overview
A Preference is a condition that can be preferred by an affirmation. The code being affirmed may choose to prefer the same opinion or not. If the two opinions differ, the facilitator will make note of the differing opinion with the description returned by this preference.
Direct Known Subclasses
And, Between, GreaterThan, Includes, Is, IsA, LessThan, Matches, Not, Or, RespondsTo, SameAs
Instance Method Summary collapse
- #&(other) ⇒ Object
-
#description ⇒ Object
If #is_preferred? returns false, this method will be called in order to generate a description of this preference, in an overall description like:.
-
#is_preferred?(actual) ⇒ Boolean
Determines whether the actual value agrees with this preference.
- #|(other) ⇒ Object
- #~ ⇒ Object
Instance Method Details
#&(other) ⇒ Object
94 95 96 |
# File 'lib/affirmit/preferences.rb', line 94 def & other return And.new self, other end |
#description ⇒ Object
If #is_preferred? returns false, this method will be called in order to generate a description of this preference, in an overall description like:
“preferred description, but was <actual>”
24 25 26 |
# File 'lib/affirmit/preference/preference.rb', line 24 def description return '' end |
#is_preferred?(actual) ⇒ Boolean
Determines whether the actual value agrees with this preference.
14 15 16 |
# File 'lib/affirmit/preference/preference.rb', line 14 def is_preferred? actual return true end |