Class: Spectre::Assertion::OrWrapper
- Inherits:
-
ValueWrapper
- Object
- ValueWrapper
- Spectre::Assertion::OrWrapper
- Defined in:
- lib/spectre/assertion.rb
Instance Method Summary collapse
- #evaluate?(predicate, actual, negate) ⇒ Boolean
-
#initialize(first, second) ⇒ OrWrapper
constructor
A new instance of OrWrapper.
-
#to_s ⇒ Object
:nodoc:.
Methods inherited from ValueWrapper
Constructor Details
#initialize(first, second) ⇒ OrWrapper
Returns a new instance of OrWrapper.
28 29 30 31 32 |
# File 'lib/spectre/assertion.rb', line 28 def initialize first, second super(first) @first = ValueWrapper.wrap(first) @second = ValueWrapper.wrap(second) end |
Instance Method Details
#evaluate?(predicate, actual, negate) ⇒ Boolean
34 35 36 |
# File 'lib/spectre/assertion.rb', line 34 def evaluate? predicate, actual, negate @first.evaluate?(predicate, actual, negate) or @second.evaluate?(predicate, actual, negate) end |
#to_s ⇒ Object
:nodoc:
39 40 41 |
# File 'lib/spectre/assertion.rb', line 39 def to_s "#{@first} or #{@second}" end |