Class: Retab::WorkflowGraphVersion

Inherits:
Types::BaseModel show all
Defined in:
lib/retab/workflows/workflow_graph_version.rb

Constant Summary collapse

HASH_ATTRS =
{
  id: :id,
  workflow_id: :workflow_id,
  blocks: :blocks,
  edges: :edges,
  block_version_ids: :block_version_ids,
  edge_version_ids: :edge_version_ids,
  created_at: :created_at
}.freeze

Instance Attribute Summary collapse

Attributes inherited from Types::BaseModel

#last_response

Instance Method Summary collapse

Methods inherited from Types::BaseModel

deep_symbolize, #inspect, normalize, #to_h, #to_json

Constructor Details

#initialize(json) ⇒ WorkflowGraphVersion

Returns a new instance of WorkflowGraphVersion.



28
29
30
31
32
33
34
35
36
37
38
# File 'lib/retab/workflows/workflow_graph_version.rb', line 28

def initialize(json)
  super()
  hash = self.class.normalize(json)
  @id = hash[:id]
  @workflow_id = hash[:workflow_id]
  @blocks = (hash[:blocks] || []).map { |item| item ? Retab::WorkflowConfigBlock.new(item) : nil }
  @edges = (hash[:edges] || []).map { |item| item ? Retab::WorkflowConfigEdge.new(item) : nil }
  @block_version_ids = (hash[:block_version_ids] || [])
  @edge_version_ids = (hash[:edge_version_ids] || [])
  @created_at = hash[:created_at]
end

Instance Attribute Details

#block_version_idsObject

Returns the value of attribute block_version_ids.



18
19
20
# File 'lib/retab/workflows/workflow_graph_version.rb', line 18

def block_version_ids
  @block_version_ids
end

#blocksObject

Returns the value of attribute blocks.



18
19
20
# File 'lib/retab/workflows/workflow_graph_version.rb', line 18

def blocks
  @blocks
end

#created_atObject

Returns the value of attribute created_at.



18
19
20
# File 'lib/retab/workflows/workflow_graph_version.rb', line 18

def created_at
  @created_at
end

#edge_version_idsObject

Returns the value of attribute edge_version_ids.



18
19
20
# File 'lib/retab/workflows/workflow_graph_version.rb', line 18

def edge_version_ids
  @edge_version_ids
end

#edgesObject

Returns the value of attribute edges.



18
19
20
# File 'lib/retab/workflows/workflow_graph_version.rb', line 18

def edges
  @edges
end

#idObject

Returns the value of attribute id.



18
19
20
# File 'lib/retab/workflows/workflow_graph_version.rb', line 18

def id
  @id
end

#workflow_idObject

Returns the value of attribute workflow_id.



18
19
20
# File 'lib/retab/workflows/workflow_graph_version.rb', line 18

def workflow_id
  @workflow_id
end