Module: Mon::Monad::ChainableMonad
Instance Method Summary
collapse
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name, *args, &fun) ⇒ Object
6
7
8
|
# File 'lib/monads/chainable_monad.rb', line 6
def method_missing(name, *args, &fun)
self.bind { |o| o.send(name, *args, &fun) }
end
|
Instance Method Details
#_ ⇒ Object
14
15
16
|
# File 'lib/monads/chainable_monad.rb', line 14
def _
self.unwrap
end
|
#coerce(other) ⇒ Object
18
19
20
|
# File 'lib/monads/chainable_monad.rb', line 18
def coerce(other)
return self, other
end
|
#respond_to?(name) ⇒ Boolean
10
11
12
|
# File 'lib/monads/chainable_monad.rb', line 10
def respond_to? name
self._canBind?(name)
end
|