Class: Functional::Some
Instance Method Summary collapse
- #get ⇒ Object
-
#initialize(value) ⇒ Some
constructor
A new instance of Some.
- #method_missing(method_sym, *args, &block) ⇒ Object
- #or_else ⇒ Object
Constructor Details
#initialize(value) ⇒ Some
Returns a new instance of Some.
120 121 122 |
# File 'lib/maybe.rb', line 120 def initialize(value) @value = value end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method_sym, *args, &block) ⇒ Object
132 133 134 |
# File 'lib/maybe.rb', line 132 def method_missing(method_sym, *args, &block) map { |value| value.send(method_sym, *args, &block) } end |