Sha256: a91df5648676b3c4453019b25938265d3bc14be328a9585b0a2f7300bb925351

Contents?: true

Size: 775 Bytes

Versions: 6

Compression:

Stored size: 775 Bytes

Contents

# module Trailblazer
#   class Activity
#     module Task
#       # Convenience functions for tasks. Totally optional.

#       # Task::Binary aka "step"
#       # Step is binary task: true=> Right, false=>Left.
#       # Step call proc.(options, flow_options)
#       # Step is supposed to run Option::KW, so `step` should be Option::KW.
#       #
#       # Returns task to call the proc with (options, flow_options), omitting `direction`.
#       # When called, the task always returns a direction signal.
#       def self.Binary(step, on_true=Activity::Right, on_false=Activity::Left)
#         ->(*args) do # Activity/Task interface.
#           [ step.(*args) ? on_true : on_false, *args ] # <=> Activity/Task interface
#         end
#       end
#     end
#   end
# end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
trailblazer-2.1.0.beta7 lib/trailblazer/task.rb
trailblazer-2.1.0.beta6 lib/trailblazer/task.rb
trailblazer-2.1.0.beta5 lib/trailblazer/task.rb
trailblazer-2.1.0.beta4 lib/trailblazer/task.rb
trailblazer-2.1.0.beta3 lib/trailblazer/task.rb
trailblazer-2.1.0.beta2 lib/trailblazer/task.rb