Class: Retab::ParseRequest

Inherits:
Types::BaseModel show all
Defined in:
lib/retab/parses/parse_request.rb

Constant Summary collapse

HASH_ATTRS =
{
  document: :document,
  model: :model,
  table_parsing_format: :table_parsing_format,
  image_resolution_dpi: :image_resolution_dpi,
  instructions: :instructions,
  bust_cache: :bust_cache
}.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) ⇒ ParseRequest

Returns a new instance of ParseRequest.



25
26
27
28
29
30
31
32
33
# File 'lib/retab/parses/parse_request.rb', line 25

def initialize(json)
  hash = self.class.normalize(json)
  @document = hash[:document] ? Retab::MimeData.new(hash[:document]) : nil
  @model = hash[:model]
  @table_parsing_format = hash[:table_parsing_format]
  @image_resolution_dpi = hash[:image_resolution_dpi]
  @instructions = hash[:instructions]
  @bust_cache = hash[:bust_cache]
end

Instance Attribute Details

#bust_cacheObject

Returns the value of attribute bust_cache.



17
18
19
# File 'lib/retab/parses/parse_request.rb', line 17

def bust_cache
  @bust_cache
end

#documentObject

Returns the value of attribute document.



17
18
19
# File 'lib/retab/parses/parse_request.rb', line 17

def document
  @document
end

#image_resolution_dpiObject

Returns the value of attribute image_resolution_dpi.



17
18
19
# File 'lib/retab/parses/parse_request.rb', line 17

def image_resolution_dpi
  @image_resolution_dpi
end

#instructionsObject

Returns the value of attribute instructions.



17
18
19
# File 'lib/retab/parses/parse_request.rb', line 17

def instructions
  @instructions
end

#modelObject

Returns the value of attribute model.



17
18
19
# File 'lib/retab/parses/parse_request.rb', line 17

def model
  @model
end

#table_parsing_formatObject

Returns the value of attribute table_parsing_format.



17
18
19
# File 'lib/retab/parses/parse_request.rb', line 17

def table_parsing_format
  @table_parsing_format
end