Class: Trailblazer::Activity::Schema

Inherits:
Struct
  • Object
show all
Defined in:
lib/trailblazer/activity/schema.rb,
lib/trailblazer/activity/schema/compiler.rb,
lib/trailblazer/activity/schema/intermediate.rb,
lib/trailblazer/activity/schema/implementation.rb

Overview

The idea with :config is to have a generic runtime store for feature fields like :wrap_static but also for flags, e.g. ‘each: true` from the Each() macro.

Defined Under Namespace

Modules: Implementation Classes: Intermediate, Nodes

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#circuitObject

Returns the value of attribute circuit

Returns:

  • (Object)

    the current value of circuit



5
6
7
# File 'lib/trailblazer/activity/schema.rb', line 5

def circuit
  @circuit
end

#configObject

Returns the value of attribute config

Returns:

  • (Object)

    the current value of config



5
6
7
# File 'lib/trailblazer/activity/schema.rb', line 5

def config
  @config
end

#nodesObject

Returns the value of attribute nodes

Returns:

  • (Object)

    the current value of nodes



5
6
7
# File 'lib/trailblazer/activity/schema.rb', line 5

def nodes
  @nodes
end

#outputsObject

Returns the value of attribute outputs

Returns:

  • (Object)

    the current value of outputs



5
6
7
# File 'lib/trailblazer/activity/schema.rb', line 5

def outputs
  @outputs
end

Class Method Details

.Nodes(nodes) ⇒ Object

Builder for Nodes datastructure.

A Nodes instance is a hash of Attributes, keyed by task. It turned out that 90% of introspect lookups, we search for attributes for a particular task, not ID. That’s why in 0.16.0 we changed this structure.5

Nodes=> #<Nodes::Attributes id= task= data= outputs=>



26
27
28
29
30
31
32
33
34
35
# File 'lib/trailblazer/activity/schema.rb', line 26

def self.Nodes(nodes)
  Nodes[
    nodes.collect do |attrs|
      [
        attrs[1], # task
        Nodes::Attributes.new(*attrs).freeze
      ]
    end
  ].freeze
end