Class: Monadic::Just::Proxy
- Inherits:
- BasicObject
- Defined in:
- lib/monadic/maybe.rb
Instance Method Summary collapse
- #__fetch__ ⇒ Object
-
#initialize(maybe) ⇒ Proxy
constructor
A new instance of Proxy.
- #method_missing(m, *args) ⇒ Object
Constructor Details
#initialize(maybe) ⇒ Proxy
Returns a new instance of Proxy.
48 49 50 |
# File 'lib/monadic/maybe.rb', line 48 def initialize(maybe) @maybe = maybe end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(m, *args) ⇒ Object
52 53 54 |
# File 'lib/monadic/maybe.rb', line 52 def method_missing(m, *args) @maybe.map { |e| e.__send__(m, *args) } end |
Instance Method Details
#__fetch__ ⇒ Object
56 57 58 |
# File 'lib/monadic/maybe.rb', line 56 def __fetch__ @maybe.fetch end |