Sha256: 369afbaaca27abcbd7cd27435478b1a83694e30e4330ce25e5d9c26347400ce5
Contents?: true
Size: 752 Bytes
Versions: 4
Compression:
Stored size: 752 Bytes
Contents
module Trailblazer class Activity # Builder for running a nested process from a specific `start_at` position. def self.Nested(*args, &block) Nested.new(*args, &block) end # Nested allows to have tasks with a different call interface and start event. # @param activity Activity interface class Nested def initialize(activity, start_with=nil, &block) @activity, @start_with, @block = activity, start_with, block end def call(start_at, *args) return @block.(activity: activity, start_at: @start_with, args: args) if @block @activity.(@start_with, *args) end # @private attr_reader :activity # we actually only need this for introspection. end end end
Version data entries
4 entries across 4 versions & 1 rubygems