Class: Retab::WorkflowConfigBlock

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

Constant Summary collapse

HASH_ATTRS =
{
  id: :id,
  type: :type,
  position: :position,
  label: :label,
  config: :config,
  resolved_schemas: :resolved_schemas,
  width: :width,
  height: :height,
  parent_id: :parent_id
}.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) ⇒ WorkflowConfigBlock

Returns a new instance of WorkflowConfigBlock.



31
32
33
34
35
36
37
38
39
40
41
42
# File 'lib/retab/workflows/workflow_config_block.rb', line 31

def initialize(json)
  hash = self.class.normalize(json)
  @id = hash[:id]
  @type = hash[:type]
  @position = hash[:position] ? Retab::WorkflowBlockPosition.new(hash[:position]) : nil
  @label = hash[:label]
  @config = hash[:config] || {}
  @resolved_schemas = hash[:resolved_schemas] || {}
  @width = hash[:width]
  @height = hash[:height]
  @parent_id = hash[:parent_id]
end

Instance Attribute Details

#configObject

Returns the value of attribute config.



20
21
22
# File 'lib/retab/workflows/workflow_config_block.rb', line 20

def config
  @config
end

#heightObject

Returns the value of attribute height.



20
21
22
# File 'lib/retab/workflows/workflow_config_block.rb', line 20

def height
  @height
end

#idObject

Returns the value of attribute id.



20
21
22
# File 'lib/retab/workflows/workflow_config_block.rb', line 20

def id
  @id
end

#labelObject

Returns the value of attribute label.



20
21
22
# File 'lib/retab/workflows/workflow_config_block.rb', line 20

def label
  @label
end

#parent_idObject

Returns the value of attribute parent_id.



20
21
22
# File 'lib/retab/workflows/workflow_config_block.rb', line 20

def parent_id
  @parent_id
end

#positionObject

Returns the value of attribute position.



20
21
22
# File 'lib/retab/workflows/workflow_config_block.rb', line 20

def position
  @position
end

#resolved_schemasObject

Returns the value of attribute resolved_schemas.



20
21
22
# File 'lib/retab/workflows/workflow_config_block.rb', line 20

def resolved_schemas
  @resolved_schemas
end

#typeObject

Returns the value of attribute type.



20
21
22
# File 'lib/retab/workflows/workflow_config_block.rb', line 20

def type
  @type
end

#widthObject

Returns the value of attribute width.



20
21
22
# File 'lib/retab/workflows/workflow_config_block.rb', line 20

def width
  @width
end