Module: Option
- Includes:
- Enumerable
- Defined in:
- lib/optional/option.rb,
lib/optional/option/match.rb,
lib/optional/option/errors.rb,
lib/optional/option/enumerable.rb
Defined Under Namespace
Modules: Enumerable Classes: BadMatchError, Match, ValueOfNoneError
Class Method Summary collapse
Instance Method Summary collapse
Methods included from Enumerable
#detect, #flat_map, #flatten, #grep, #juxt, #map, #map_through, #reduce, #reject, #select, #to_ary
Class Method Details
Instance Method Details
#match(&block) ⇒ Object
8 9 10 |
# File 'lib/optional/option.rb', line 8 def match(&block) Match.new.tap { |m| block.call(m) }.evaluate(self) end |