Module: Qo::Branches

Defined in:
lib/qo/branches/branches.rb,
lib/qo/branches/branch.rb,
lib/qo/branches/else_branch.rb,
lib/qo/branches/when_branch.rb,
lib/qo/branches/error_branch.rb,
lib/qo/branches/failure_branch.rb,
lib/qo/branches/success_branch.rb,
lib/qo/branches/monadic_else_branch.rb,
lib/qo/branches/monadic_when_branch.rb

Overview

In Qo, a Branch is one of the callable branches in a pattern match. Most commonly you'll see this expressed in a where or else branch, named as such to emulate a case statement:

Qo.match { |m|
  m.when(conditions) { code executed when matched }
  m.else { code executed otherwise }
}

More documentation on the creation of branches is available in Branch

See Also:

Author:

  • baweaver

Since:

  • 1.0.0

Defined Under Namespace

Classes: Branch, ElseBranch, ErrorBranch, FailureBranch, MonadicElseBranch, MonadicWhenBranch, SuccessBranch, WhenBranch