Class: Retab::Parse
- Inherits:
-
Types::BaseModel
- Object
- Types::BaseModel
- Retab::Parse
- Defined in:
- lib/retab/parses/parse.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 }.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.
-
#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) ⇒ Parse
constructor
A new instance of Parse.
Methods inherited from Types::BaseModel
deep_symbolize, #inspect, normalize, #to_h, #to_json
Constructor Details
#initialize(json) ⇒ Parse
Returns a new instance of Parse.
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/retab/parses/parse.rb', line 36 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] end |
Instance Attribute Details
#created_at ⇒ Object
Returns the value of attribute created_at.
22 23 24 |
# File 'lib/retab/parses/parse.rb', line 22 def created_at @created_at end |
#error ⇒ Object
Returns the value of attribute error.
22 23 24 |
# File 'lib/retab/parses/parse.rb', line 22 def error @error end |
#file ⇒ Object
Returns the value of attribute file.
22 23 24 |
# File 'lib/retab/parses/parse.rb', line 22 def file @file end |
#id ⇒ Object
Returns the value of attribute id.
22 23 24 |
# File 'lib/retab/parses/parse.rb', line 22 def id @id end |
#image_resolution_dpi ⇒ Object
Returns the value of attribute image_resolution_dpi.
22 23 24 |
# File 'lib/retab/parses/parse.rb', line 22 def image_resolution_dpi @image_resolution_dpi end |
#instructions ⇒ Object
Returns the value of attribute instructions.
22 23 24 |
# File 'lib/retab/parses/parse.rb', line 22 def instructions @instructions end |
#model ⇒ Object
Returns the value of attribute model.
22 23 24 |
# File 'lib/retab/parses/parse.rb', line 22 def model @model end |
#output ⇒ Object
Returns the value of attribute output.
22 23 24 |
# File 'lib/retab/parses/parse.rb', line 22 def output @output end |
#status ⇒ Object
Returns the value of attribute status.
22 23 24 |
# File 'lib/retab/parses/parse.rb', line 22 def status @status end |
#table_parsing_format ⇒ Object
Returns the value of attribute table_parsing_format.
22 23 24 |
# File 'lib/retab/parses/parse.rb', line 22 def table_parsing_format @table_parsing_format end |
#usage ⇒ Object
Returns the value of attribute usage.
22 23 24 |
# File 'lib/retab/parses/parse.rb', line 22 def usage @usage end |