Class: Highway::Compiler::Build::Output::Invocation

Inherits:
Object
  • Object
show all
Defined in:
lib/highway/compiler/build/output/invocation.rb

Overview

This class represents a step invocation in the build manifest. It contains information about step definition class, parameters and execution policy.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(index:, step_class:, parameters:, policy:, keypath:) ⇒ Invocation

Initialize an instance.

Parameters:

  • index (Integer)

    Index of invocation, 1-based.

  • step_class (Class)

    Definition class of the step.

  • parameters (Highway::Compiler::Analyze::Tree::Values::Hash)

    Hash value of step parameters.

  • policy (Symbol)

    Execution policy of the step invocation.

  • keypath (Array<String>)

    A keypath used for debugging purposes.



25
26
27
28
29
30
31
# File 'lib/highway/compiler/build/output/invocation.rb', line 25

def initialize(index:, step_class:, parameters:, policy:, keypath:)
  @index = index
  @step_class = step_class
  @parameters = parameters
  @policy = policy
  @keypath = keypath
end

Instance Attribute Details

#indexInteger (readonly)

Index of invocation, 1-based.

Returns:

  • (Integer)


36
37
38
# File 'lib/highway/compiler/build/output/invocation.rb', line 36

def index
  @index
end

#keypathArray<String> (readonly)

A keypath used for debugging purposes.

Returns:

  • (Array<String>)


56
57
58
# File 'lib/highway/compiler/build/output/invocation.rb', line 56

def keypath
  @keypath
end

#parametersHighway::Compiler::Analyze::Tree::Values::Hash (readonly)

Hash value of step parameters.



46
47
48
# File 'lib/highway/compiler/build/output/invocation.rb', line 46

def parameters
  @parameters
end

#policySymbol (readonly)

Execution policy of the step invocation.

Returns:

  • (Symbol)


51
52
53
# File 'lib/highway/compiler/build/output/invocation.rb', line 51

def policy
  @policy
end

#step_classClass (readonly)

Definition class of the step.

Returns:

  • (Class)


41
42
43
# File 'lib/highway/compiler/build/output/invocation.rb', line 41

def step_class
  @step_class
end

Instance Method Details

#identifierString

An identifier of the invocation, joined by index and step name.

Returns:

  • (String)


61
62
63
# File 'lib/highway/compiler/build/output/invocation.rb', line 61

def identifier
  return "#{index}-#{step_class.name}"
end