Class: Core::Pipeline::Action
- Inherits:
-
Object
- Object
- Core::Pipeline::Action
- Defined in:
- lib/core/pipeline/action.rb
Overview
- public
-
A pipeline action.
Direct Known Subclasses
Core::Pipeline::Actions::Block, Core::Pipeline::Actions::Method
Instance Attribute Summary collapse
-
#after ⇒ Object
readonly
- public
-
The name of the action this action should be called after.
-
#before ⇒ Object
readonly
- public
-
The name of the action this action should be called before.
-
#name ⇒ Object
readonly
- public
-
The action name.
Class Method Summary collapse
-
.build(target = nil, *args, context:, before:, after:, &block) ⇒ Object
- public
-
Builds an action for a given target.
Instance Method Summary collapse
-
#finalize(context) ⇒ Object
- public
-
Finalizes the action for the given context.
-
#initialize(before:, after:) ⇒ Action
constructor
A new instance of Action.
Constructor Details
#initialize(before:, after:) ⇒ Action
Returns a new instance of Action.
35 36 37 38 |
# File 'lib/core/pipeline/action.rb', line 35 def initialize(before:, after:) @before = before @after = after end |
Instance Attribute Details
#after ⇒ Object (readonly)
- public
-
The name of the action this action should be called after.
50 51 52 |
# File 'lib/core/pipeline/action.rb', line 50 def after @after end |
#before ⇒ Object (readonly)
- public
-
The name of the action this action should be called before.
46 47 48 |
# File 'lib/core/pipeline/action.rb', line 46 def before @before end |
#name ⇒ Object (readonly)
- public
-
The action name.
42 43 44 |
# File 'lib/core/pipeline/action.rb', line 42 def name @name end |
Class Method Details
.build(target = nil, *args, context:, before:, after:, &block) ⇒ Object
- public
-
Builds an action for a given target.
11 12 13 14 15 16 17 |
# File 'lib/core/pipeline/action.rb', line 11 def build(target = nil, *args, context:, before:, after:, &block) if block Actions::Block.new(target, before: before, after: after, &block) else build_target(target, *args, before: before, after: after) end end |
Instance Method Details
#finalize(context) ⇒ Object
- public
-
Finalizes the action for the given context.
54 55 56 |
# File 'lib/core/pipeline/action.rb', line 54 def finalize(context) raise "not implemented" end |