Class: Monadic::Either::Chain
Instance Method Summary collapse
- #bind(proc = nil, &block) ⇒ Object (also: #>=)
- #call(initial) ⇒ Object
-
#initialize(&block) ⇒ Chain
constructor
A new instance of Chain.
Constructor Details
#initialize(&block) ⇒ Chain
Returns a new instance of Chain.
80 81 82 83 |
# File 'lib/monadic/either.rb', line 80 def initialize(&block) @chain = [] instance_eval(&block) end |
Instance Method Details
#bind(proc = nil, &block) ⇒ Object Also known as: >=
91 92 93 |
# File 'lib/monadic/either.rb', line 91 def bind(proc=nil, &block) @chain << (proc || block) end |