Class: WorkflowTemplate::State::Meta

Inherits:
Object
  • Object
show all
Defined in:
lib/workflow_template/state/meta.rb

Defined Under Namespace

Modules: Null

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(trace: []) ⇒ Meta

Returns a new instance of Meta.



26
27
28
# File 'lib/workflow_template/state/meta.rb', line 26

def initialize(trace: [])
  @trace = trace.freeze
end

Instance Attribute Details

#traceObject (readonly)

Returns the value of attribute trace.



18
19
20
# File 'lib/workflow_template/state/meta.rb', line 18

def trace
  @trace
end

Class Method Details

.instance(trace) ⇒ Object



20
21
22
# File 'lib/workflow_template/state/meta.rb', line 20

def self.instance(trace)
  trace ? new : Null
end

Instance Method Details

#add(name) ⇒ Object



30
31
32
# File 'lib/workflow_template/state/meta.rb', line 30

def add(name)
  self.class.send :new, trace: [*@trace, name]
end