Class: Retab::ParseWorkflowArtifact
- Inherits:
-
Types::BaseModel
- Object
- Types::BaseModel
- Retab::ParseWorkflowArtifact
- 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, status: :status, error: :error, usage: :usage, created_at: :created_at, operation: :operation }.freeze
Instance Attribute Summary collapse
-
#created_at ⇒ Object
Returns the value of attribute created_at.
-
#error ⇒ Object
Returns the value of attribute error.
-
#file ⇒ Object
Returns the value of attribute file.
-
#id ⇒ Object
Returns the value of attribute id.
-
#image_resolution_dpi ⇒ Object
Returns the value of attribute image_resolution_dpi.
-
#instructions ⇒ Object
Returns the value of attribute instructions.
-
#model ⇒ Object
Returns the value of attribute model.
-
#operation ⇒ Object
Returns the value of attribute operation.
-
#output ⇒ Object
Returns the value of attribute output.
-
#status ⇒ Object
Returns the value of attribute status.
-
#table_parsing_format ⇒ Object
Returns the value of attribute table_parsing_format.
-
#usage ⇒ Object
Returns the value of attribute usage.
Attributes inherited from Types::BaseModel
Instance Method Summary collapse
-
#initialize(json) ⇒ ParseWorkflowArtifact
constructor
A new instance of ParseWorkflowArtifact.
Methods inherited from Types::BaseModel
deep_symbolize, #inspect, normalize, #to_h, #to_json
Constructor Details
#initialize(json) ⇒ ParseWorkflowArtifact
Returns a new instance of ParseWorkflowArtifact.
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/retab/workflow_artifacts/parse_workflow_artifact.rb', line 38 def initialize(json) super() 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 @status = hash[:status].nil? ? "pending" : hash[:status] @error = hash[:error] ? Retab::PrimitiveError.new(hash[:error]) : nil @usage = hash[:usage] ? Retab::RetabUsage.new(hash[:usage]) : nil @created_at = hash[:created_at] @operation = hash[:operation].nil? ? "parse" : hash[:operation] end |
Instance Attribute Details
#created_at ⇒ Object
Returns the value of attribute created_at.
23 24 25 |
# File 'lib/retab/workflow_artifacts/parse_workflow_artifact.rb', line 23 def created_at @created_at end |
#error ⇒ Object
Returns the value of attribute error.
23 24 25 |
# File 'lib/retab/workflow_artifacts/parse_workflow_artifact.rb', line 23 def error @error end |
#file ⇒ Object
Returns the value of attribute file.
23 24 25 |
# File 'lib/retab/workflow_artifacts/parse_workflow_artifact.rb', line 23 def file @file end |
#id ⇒ Object
Returns the value of attribute id.
23 24 25 |
# File 'lib/retab/workflow_artifacts/parse_workflow_artifact.rb', line 23 def id @id end |
#image_resolution_dpi ⇒ Object
Returns the value of attribute image_resolution_dpi.
23 24 25 |
# File 'lib/retab/workflow_artifacts/parse_workflow_artifact.rb', line 23 def image_resolution_dpi @image_resolution_dpi end |
#instructions ⇒ Object
Returns the value of attribute instructions.
23 24 25 |
# File 'lib/retab/workflow_artifacts/parse_workflow_artifact.rb', line 23 def instructions @instructions end |
#model ⇒ Object
Returns the value of attribute model.
23 24 25 |
# File 'lib/retab/workflow_artifacts/parse_workflow_artifact.rb', line 23 def model @model end |
#operation ⇒ Object
Returns the value of attribute operation.
23 24 25 |
# File 'lib/retab/workflow_artifacts/parse_workflow_artifact.rb', line 23 def operation @operation end |
#output ⇒ Object
Returns the value of attribute output.
23 24 25 |
# File 'lib/retab/workflow_artifacts/parse_workflow_artifact.rb', line 23 def output @output end |
#status ⇒ Object
Returns the value of attribute status.
23 24 25 |
# File 'lib/retab/workflow_artifacts/parse_workflow_artifact.rb', line 23 def status @status end |
#table_parsing_format ⇒ Object
Returns the value of attribute table_parsing_format.
23 24 25 |
# File 'lib/retab/workflow_artifacts/parse_workflow_artifact.rb', line 23 def table_parsing_format @table_parsing_format end |
#usage ⇒ Object
Returns the value of attribute usage.
23 24 25 |
# File 'lib/retab/workflow_artifacts/parse_workflow_artifact.rb', line 23 def usage @usage end |