Class: Literal::Either Abstract
- Inherits:
-
Object
- Object
- Literal::Either
- Extended by:
- Modifiers
- Defined in:
- lib/literal/either.rb
Overview
This class is abstract.
Instance Attribute Summary collapse
-
#type ⇒ Object
Returns the value of attribute type.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(value) ⇒ Either
constructor
A new instance of Either.
- #inspect ⇒ String
- #left ⇒ Literal::Either
- #left? ⇒ Boolean
- #right ⇒ Literal::Either
- #right? ⇒ Boolean
Methods included from Modifiers
Constructor Details
#initialize(value) ⇒ Either
Returns a new instance of Either.
7 8 9 10 |
# File 'lib/literal/either.rb', line 7 def initialize(value) @value = value freeze end |
Instance Attribute Details
#type ⇒ Object
Returns the value of attribute type.
35 36 37 |
# File 'lib/literal/either.rb', line 35 def type @type end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
34 35 36 |
# File 'lib/literal/either.rb', line 34 def value @value end |
Instance Method Details
#inspect ⇒ String
16 |
# File 'lib/literal/either.rb', line 16 abstract def inspect = nil |
#left? ⇒ Boolean
20 |
# File 'lib/literal/either.rb', line 20 abstract def left? = nil |
#right? ⇒ Boolean
24 |
# File 'lib/literal/either.rb', line 24 abstract def right? = nil |