class Qo::Branches::MonadicElseBranch

Based on the `else` branch, except deals with monadic values by attempting to extract the `value` before yielding to the given function on a match:

“`ruby Matcher.new.call(Some) { |m|

m.else { |v| v + 2 }

} # => 3 “`

@author baweaver @since 1.0.0

Public Class Methods

new(destructure: false, extractor: :value) click to toggle source
Calls superclass method Qo::Branches::Branch::new
# File lib/qo/branches/monadic_else_branch.rb, line 16
def initialize(destructure: false, extractor: :value)
  super(
    name: 'else',
    destructure: destructure,
    extractor: extractor,
    default: true,
  )
end