Class: Retab::WorkflowBlockVersion

Inherits:
Types::BaseModel show all
Defined in:
lib/retab/workflow_blocks/workflow_block_version.rb

Constant Summary collapse

HASH_ATTRS =
{
  id: :id,
  block_id: :block_id,
  workflow_id: :workflow_id,
  workflow_version_id: :workflow_version_id,
  type: :type,
  label: :label,
  position_x: :position_x,
  position_y: :position_y,
  width: :width,
  height: :height,
  parent_id: :parent_id,
  config: :config,
  resolved_schemas: :resolved_schemas,
  config_hash: :config_hash,
  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) ⇒ WorkflowBlockVersion

Returns a new instance of WorkflowBlockVersion.



44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# File 'lib/retab/workflow_blocks/workflow_block_version.rb', line 44

def initialize(json)
  super()
  hash = self.class.normalize(json)
  @id = hash[:id]
  @block_id = hash[:block_id]
  @workflow_id = hash[:workflow_id]
  @workflow_version_id = hash[:workflow_version_id]
  @type = hash[:type]
  @label = hash[:label].nil? ? "" : hash[:label]
  @position_x = hash[:position_x]
  @position_y = hash[:position_y]
  @width = hash[:width]
  @height = hash[:height]
  @parent_id = hash[:parent_id]
  @config = hash[:config] || {}
  @resolved_schemas = hash[:resolved_schemas] || {}
  @config_hash = hash[:config_hash].nil? ? "" : hash[:config_hash]
  @created_at = hash[:created_at]
end

Instance Attribute Details

#block_idObject

Returns the value of attribute block_id.



26
27
28
# File 'lib/retab/workflow_blocks/workflow_block_version.rb', line 26

def block_id
  @block_id
end

#configObject

Returns the value of attribute config.



26
27
28
# File 'lib/retab/workflow_blocks/workflow_block_version.rb', line 26

def config
  @config
end

#config_hashObject

Returns the value of attribute config_hash.



26
27
28
# File 'lib/retab/workflow_blocks/workflow_block_version.rb', line 26

def config_hash
  @config_hash
end

#created_atObject

Returns the value of attribute created_at.



26
27
28
# File 'lib/retab/workflow_blocks/workflow_block_version.rb', line 26

def created_at
  @created_at
end

#heightObject

Returns the value of attribute height.



26
27
28
# File 'lib/retab/workflow_blocks/workflow_block_version.rb', line 26

def height
  @height
end

#idObject

Returns the value of attribute id.



26
27
28
# File 'lib/retab/workflow_blocks/workflow_block_version.rb', line 26

def id
  @id
end

#labelObject

Returns the value of attribute label.



26
27
28
# File 'lib/retab/workflow_blocks/workflow_block_version.rb', line 26

def label
  @label
end

#parent_idObject

Returns the value of attribute parent_id.



26
27
28
# File 'lib/retab/workflow_blocks/workflow_block_version.rb', line 26

def parent_id
  @parent_id
end

#position_xObject

Returns the value of attribute position_x.



26
27
28
# File 'lib/retab/workflow_blocks/workflow_block_version.rb', line 26

def position_x
  @position_x
end

#position_yObject

Returns the value of attribute position_y.



26
27
28
# File 'lib/retab/workflow_blocks/workflow_block_version.rb', line 26

def position_y
  @position_y
end

#resolved_schemasObject

Returns the value of attribute resolved_schemas.



26
27
28
# File 'lib/retab/workflow_blocks/workflow_block_version.rb', line 26

def resolved_schemas
  @resolved_schemas
end

#typeObject

Returns the value of attribute type.



26
27
28
# File 'lib/retab/workflow_blocks/workflow_block_version.rb', line 26

def type
  @type
end

#widthObject

Returns the value of attribute width.



26
27
28
# File 'lib/retab/workflow_blocks/workflow_block_version.rb', line 26

def width
  @width
end

#workflow_idObject

Returns the value of attribute workflow_id.



26
27
28
# File 'lib/retab/workflow_blocks/workflow_block_version.rb', line 26

def workflow_id
  @workflow_id
end

#workflow_version_idObject

Returns the value of attribute workflow_version_id.



26
27
28
# File 'lib/retab/workflow_blocks/workflow_block_version.rb', line 26

def workflow_version_id
  @workflow_version_id
end