Sha256: 660023f5db82928d334b859787c21b6d2eb63eb5577ef273366fb1af8512819a

Contents?: true

Size: 885 Bytes

Versions: 8

Compression:

Stored size: 885 Bytes

Contents

module Trailblazer
  module Activity::TaskWrap
    # This is instantiated via the DSL, and passed to the :extension API,
    # allowing to add steps to the Activity's static_wrap.
    # Compile-time function
    class Merge
      def initialize(extension_plan)
        @extension_plan = extension_plan
      end

      # {:extension API}
      def call(activity, task, local_options, *returned_options)
        # we could make the default initial_activity injectable via the DSL, the value would sit in returned_options or local_options.
        static_wrap = Activity::TaskWrap.wrap_static_for(task, wrap_static: activity[:wrap_static] || {})

        # # macro might want to apply changes to the static task_wrap (e.g. Inject)
        new_wrap =  Activity::Path::Plan.merge( static_wrap, @extension_plan )

        activity[:wrap_static, task] = new_wrap
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
trailblazer-activity-0.5.2 lib/trailblazer/activity/task_wrap/merge.rb
trailblazer-activity-0.5.1 lib/trailblazer/activity/task_wrap/merge.rb
trailblazer-activity-0.5.0 lib/trailblazer/activity/task_wrap/merge.rb
trailblazer-activity-0.4.3 lib/trailblazer/activity/task_wrap/merge.rb
trailblazer-activity-0.4.2 lib/trailblazer/activity/task_wrap/merge.rb
trailblazer-activity-0.4.1 lib/trailblazer/activity/task_wrap/merge.rb
trailblazer-activity-0.4.0 lib/trailblazer/activity/task_wrap/merge.rb
trailblazer-activity-0.4.o lib/trailblazer/activity/task_wrap/merge.rb