Class: Mon::Monad::React
- Includes:
- ChainableMonad
- Defined in:
- lib/monads/reactron.rb
Overview
The React class is the parent of Reactron and Reactor. The key difference between the two is the presence of the << operator. The value of a Reactor is derived from a Reactron, and cannot be directly changed. If viewed as a tree, Reactrons are the root, and only the root may be changed.
However, we can have more than one root! m = React[2] # ==> Reactron[2] n = React[10] # ==> Reactron[10] v = m * n # Currently v == Reactor[20] n << 5 # Now v == Reactor[10]
Usage of React is straightforward: r = React[some_value]
Class Method Summary collapse
Methods included from ChainableMonad
#_, #coerce, #method_missing, #respond_to?
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Mon::Monad::ChainableMonad