Class: Trailblazer::Operation::Controller::Else

Inherits:
Object
  • Object
show all
Defined in:
lib/trailblazer/operation/controller.rb

Overview

full-on Op[] Note: this is not documented on purpose as this concept is experimental. I don’t like it too much and prefer returns in the valid block.

Instance Method Summary collapse

Constructor Details

#initialize(op, run) ⇒ Else

Returns a new instance of Else.



30
31
32
33
# File 'lib/trailblazer/operation/controller.rb', line 30

def initialize(op, run)
  @op  = op
  @run = run
end

Instance Method Details

#else {|@op| ... } ⇒ Object

Yields:

  • (@op)


35
36
37
# File 'lib/trailblazer/operation/controller.rb', line 35

def else
  yield @op if @run
end