Class: Eventually
Instance Attribute Summary collapse
-
#block ⇒ Object
Returns the value of attribute block.
Instance Method Summary collapse
Methods included from Monad
Instance Attribute Details
#block ⇒ Object
Returns the value of attribute block
45 46 47 |
# File 'lib/maybe.rb', line 45 def block @block end |
Instance Method Details
#and_then(&block) ⇒ Object
46 47 48 49 50 51 52 |
# File 'lib/maybe.rb', line 46 def and_then(&block) Eventually.new do |success| run do |value| block.call(value).run(&success) end end end |