Class: Retab::ParseWorkflowArtifact

Inherits:
Types::BaseModel show all
Defined in:
lib/retab/workflow_artifacts/parse_workflow_artifact.rb

Constant Summary collapse

HASH_ATTRS =
{
  id: :id,
  file: :file,
  model: :model,
  table_parsing_format: :table_parsing_format,
  image_resolution_dpi: :image_resolution_dpi,
  instructions: :instructions,
  output: :output,
  usage: :usage,
  created_at: :created_at,
  operation: :operation
}.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) ⇒ ParseWorkflowArtifact

Returns a new instance of ParseWorkflowArtifact.



33
34
35
36
37
38
39
40
41
42
43
44
45
# File 'lib/retab/workflow_artifacts/parse_workflow_artifact.rb', line 33

def initialize(json)
  hash = self.class.normalize(json)
  @id = hash[:id]
  @file = hash[:file] ? Retab::FileRef.new(hash[:file]) : nil
  @model = hash[:model]
  @table_parsing_format = hash[:table_parsing_format]
  @image_resolution_dpi = hash[:image_resolution_dpi]
  @instructions = hash[:instructions]
  @output = hash[:output] ? Retab::ParseOutput.new(hash[:output]) : nil
  @usage = hash[:usage] ? Retab::RetabUsage.new(hash[:usage]) : nil
  @created_at = hash[:created_at]
  @operation = hash[:operation]
end

Instance Attribute Details

#created_atObject

Returns the value of attribute created_at.



21
22
23
# File 'lib/retab/workflow_artifacts/parse_workflow_artifact.rb', line 21

def created_at
  @created_at
end

#fileObject

Returns the value of attribute file.



21
22
23
# File 'lib/retab/workflow_artifacts/parse_workflow_artifact.rb', line 21

def file
  @file
end

#idObject

Returns the value of attribute id.



21
22
23
# File 'lib/retab/workflow_artifacts/parse_workflow_artifact.rb', line 21

def id
  @id
end

#image_resolution_dpiObject

Returns the value of attribute image_resolution_dpi.



21
22
23
# File 'lib/retab/workflow_artifacts/parse_workflow_artifact.rb', line 21

def image_resolution_dpi
  @image_resolution_dpi
end

#instructionsObject

Returns the value of attribute instructions.



21
22
23
# File 'lib/retab/workflow_artifacts/parse_workflow_artifact.rb', line 21

def instructions
  @instructions
end

#modelObject

Returns the value of attribute model.



21
22
23
# File 'lib/retab/workflow_artifacts/parse_workflow_artifact.rb', line 21

def model
  @model
end

#operationObject

Returns the value of attribute operation.



21
22
23
# File 'lib/retab/workflow_artifacts/parse_workflow_artifact.rb', line 21

def operation
  @operation
end

#outputObject

Returns the value of attribute output.



21
22
23
# File 'lib/retab/workflow_artifacts/parse_workflow_artifact.rb', line 21

def output
  @output
end

#table_parsing_formatObject

Returns the value of attribute table_parsing_format.



21
22
23
# File 'lib/retab/workflow_artifacts/parse_workflow_artifact.rb', line 21

def table_parsing_format
  @table_parsing_format
end

#usageObject

Returns the value of attribute usage.



21
22
23
# File 'lib/retab/workflow_artifacts/parse_workflow_artifact.rb', line 21

def usage
  @usage
end