Module: Trailblazer::Activity::Path::Plan
- Defined in:
- lib/trailblazer/activity/dsl/strategy/plan.rb
Defined Under Namespace
Modules: Methods
Class Method Summary collapse
- .extended(extended) ⇒ Object
-
.merge(activity, plan) ⇒ Activity
Creates a copy of the activity module and merges the Plan into it.
- .merge!(activity, plan) ⇒ Object
Class Method Details
.extended(extended) ⇒ Object
8 9 10 11 12 |
# File 'lib/trailblazer/activity/dsl/strategy/plan.rb', line 8 def self.extended(extended) extended.singleton_class.send :attr_accessor, :record extended.record = [] extended.extend(Methods) end |
.merge(activity, plan) ⇒ Activity
Creates a copy of the activity module and merges the Trailblazer::Activity::Path::Plan into it.
30 31 32 |
# File 'lib/trailblazer/activity/dsl/strategy/plan.rb', line 30 def self.merge(activity, plan) merge!(activity.clone, plan) end |
.merge!(activity, plan) ⇒ Object
20 21 22 23 |
# File 'lib/trailblazer/activity/dsl/strategy/plan.rb', line 20 def self.merge!(activity, plan) plan.record.each { |(dsl_method, args, block)| activity.send(dsl_method, *args, &block) } activity end |