Class: Trither::Box
Direct Known Subclasses
Either::Left, Either::Right, Option::Some, Try::Failure, Try::Success
Constant Summary collapse
- C =
Contracts
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(value) ⇒ Box
constructor
A new instance of Box.
Constructor Details
#initialize(value) ⇒ Box
Returns a new instance of Box.
10 11 12 |
# File 'lib/trither.rb', line 10 def initialize(value) @value = value end |
Instance Method Details
#==(other) ⇒ Object
15 16 17 18 |
# File 'lib/trither.rb', line 15 def ==(other) (self.class == other.class) && (@value == other.instance_variable_get('@value')) end |