Class: Core::Pipeline::Action

Inherits:
Object
  • Object
show all
Defined in:
lib/core/pipeline/action.rb

Overview

public

A pipeline action.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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

#afterObject (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

#beforeObject (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

#nameObject (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