Module: Maybe
- Defined in:
- lib/maybe.rb
Defined Under Namespace
Class Method Summary collapse
Class Method Details
.match(m, just:, nothing:) ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/maybe.rb', line 17 def self.match(m, just:, nothing:) if m.is_just? just.call(m.send(:val)) elsif m.is_nothing? if nothing.is_a? Proc nothing.call else nothing end end end |