Class: Maybe::Just
Instance Method Summary collapse
- #flat_map {|val| ... } ⇒ Object
-
#initialize(val) ⇒ Just
constructor
A new instance of Just.
- #is_just? ⇒ Boolean
- #is_nothing? ⇒ Boolean
- #map ⇒ Object
Methods included from Shared
Constructor Details
#initialize(val) ⇒ Just
Returns a new instance of Just.
39 40 41 |
# File 'lib/maybe.rb', line 39 def initialize(val) @val = val end |
Instance Method Details
#flat_map {|val| ... } ⇒ Object
47 48 49 |
# File 'lib/maybe.rb', line 47 def flat_map yield val end |
#is_just? ⇒ Boolean
32 33 34 |
# File 'lib/maybe.rb', line 32 def is_just? true end |
#is_nothing? ⇒ Boolean
35 36 37 |
# File 'lib/maybe.rb', line 35 def is_nothing? false end |