Class: USaidWat::Either
- Inherits:
-
Object
- Object
- USaidWat::Either
- Defined in:
- lib/usaidwat/either.rb
Instance Attribute Summary collapse
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
- #>>(&block) ⇒ Object
-
#initialize(value) ⇒ Either
constructor
A new instance of Either.
- #left? ⇒ Boolean
- #right? ⇒ Boolean
Constructor Details
#initialize(value) ⇒ Either
Returns a new instance of Either.
5 6 7 |
# File 'lib/usaidwat/either.rb', line 5 def initialize(value) @value = value end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
3 4 5 |
# File 'lib/usaidwat/either.rb', line 3 def value @value end |
Instance Method Details
#>>(&block) ⇒ Object
9 10 11 |
# File 'lib/usaidwat/either.rb', line 9 def >>(&block) raise NoMethodError, 'subclasses must define >>' end |
#left? ⇒ Boolean
13 14 15 |
# File 'lib/usaidwat/either.rb', line 13 def left? false end |
#right? ⇒ Boolean
17 18 19 |
# File 'lib/usaidwat/either.rb', line 17 def right? false end |