Class: Monadic::Just::Proxy

Inherits:
BasicObject
Defined in:
lib/monadic/maybe.rb

Instance Method Summary collapse

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