Class: Retab::WorkflowBlock

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

Constant Summary collapse

HASH_ATTRS =
{
  id: :id,
  workflow_id: :workflow_id,
  type: :type,
  label: :label,
  position_x: :position_x,
  position_y: :position_y,
  width: :width,
  height: :height,
  config: :config,
  parent_id: :parent_id,
  updated_at: :updated_at,
  resolved_schemas: :resolved_schemas
}.freeze

Instance Attribute Summary collapse

Attributes inherited from Types::BaseModel

#last_response

Instance Method Summary collapse

Methods inherited from Types::BaseModel

#inspect, normalize, #to_h, #to_json

Constructor Details

#initialize(json) ⇒ WorkflowBlock

Returns a new instance of WorkflowBlock.



37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# File 'lib/retab/workflow_blocks/workflow_block.rb', line 37

def initialize(json)
  hash = self.class.normalize(json)
  @id = hash[:id]
  @workflow_id = hash[:workflow_id]
  @type = hash[:type]
  @label = hash[:label]
  @position_x = hash[:position_x]
  @position_y = hash[:position_y]
  @width = hash[:width]
  @height = hash[:height]
  @config = hash[:config] || {}
  @parent_id = hash[:parent_id]
  @updated_at = hash[:updated_at]
  @resolved_schemas = hash[:resolved_schemas] || {}
end

Instance Attribute Details

#configObject

Returns the value of attribute config.



23
24
25
# File 'lib/retab/workflow_blocks/workflow_block.rb', line 23

def config
  @config
end

#heightObject

Returns the value of attribute height.



23
24
25
# File 'lib/retab/workflow_blocks/workflow_block.rb', line 23

def height
  @height
end

#idObject

Returns the value of attribute id.



23
24
25
# File 'lib/retab/workflow_blocks/workflow_block.rb', line 23

def id
  @id
end

#labelObject

Returns the value of attribute label.



23
24
25
# File 'lib/retab/workflow_blocks/workflow_block.rb', line 23

def label
  @label
end

#parent_idObject

Returns the value of attribute parent_id.



23
24
25
# File 'lib/retab/workflow_blocks/workflow_block.rb', line 23

def parent_id
  @parent_id
end

#position_xObject

Returns the value of attribute position_x.



23
24
25
# File 'lib/retab/workflow_blocks/workflow_block.rb', line 23

def position_x
  @position_x
end

#position_yObject

Returns the value of attribute position_y.



23
24
25
# File 'lib/retab/workflow_blocks/workflow_block.rb', line 23

def position_y
  @position_y
end

#resolved_schemasObject

Returns the value of attribute resolved_schemas.



23
24
25
# File 'lib/retab/workflow_blocks/workflow_block.rb', line 23

def resolved_schemas
  @resolved_schemas
end

#typeObject

Returns the value of attribute type.



23
24
25
# File 'lib/retab/workflow_blocks/workflow_block.rb', line 23

def type
  @type
end

#updated_atObject

Returns the value of attribute updated_at.



23
24
25
# File 'lib/retab/workflow_blocks/workflow_block.rb', line 23

def updated_at
  @updated_at
end

#widthObject

Returns the value of attribute width.



23
24
25
# File 'lib/retab/workflow_blocks/workflow_block.rb', line 23

def width
  @width
end

#workflow_idObject

Returns the value of attribute workflow_id.



23
24
25
# File 'lib/retab/workflow_blocks/workflow_block.rb', line 23

def workflow_id
  @workflow_id
end