Class: Either::Match::Evaluation
- Inherits:
-
Object
- Object
- Either::Match::Evaluation
- Defined in:
- lib/either/match.rb
Instance Attribute Summary collapse
-
#either ⇒ Object
readonly
Returns the value of attribute either.
-
#match ⇒ Object
readonly
Returns the value of attribute match.
Instance Method Summary collapse
-
#initialize(match, either) ⇒ Evaluation
constructor
A new instance of Evaluation.
- #result ⇒ Object
Constructor Details
#initialize(match, either) ⇒ Evaluation
35 36 37 38 |
# File 'lib/either/match.rb', line 35 def initialize(match, either) @match = match @either = either end |
Instance Attribute Details
#either ⇒ Object (readonly)
Returns the value of attribute either.
40 41 42 |
# File 'lib/either/match.rb', line 40 def either @either end |
#match ⇒ Object (readonly)
Returns the value of attribute match.
40 41 42 |
# File 'lib/either/match.rb', line 40 def match @match end |
Instance Method Details
#result ⇒ Object
42 43 44 |
# File 'lib/either/match.rb', line 42 def result either.left? ? left_result : right_result end |