Class: Spectre::Assertion::OrEvaluation
- Inherits:
-
Evaluation
- Object
- Evaluation
- Spectre::Assertion::OrEvaluation
- Defined in:
- lib/spectre/assertion.rb
Instance Method Summary collapse
-
#initialize(val, other) ⇒ OrEvaluation
constructor
A new instance of OrEvaluation.
- #run(&block) ⇒ Object
- #to_s ⇒ Object
Methods inherited from Evaluation
Constructor Details
#initialize(val, other) ⇒ OrEvaluation
Returns a new instance of OrEvaluation.
201 202 203 204 |
# File 'lib/spectre/assertion.rb', line 201 def initialize val, other @val = val @other = other end |
Instance Method Details
#run(&block) ⇒ Object
206 207 208 209 210 |
# File 'lib/spectre/assertion.rb', line 206 def run &block res1 = evaluate(@val, block) res2 = evaluate(@other, block) res1 or res2 end |
#to_s ⇒ Object
212 213 214 |
# File 'lib/spectre/assertion.rb', line 212 def to_s "(#{@val} or #{@other})" end |