Class: Retab::ExtractionRequest
- Inherits:
-
Types::BaseModel
- Object
- Types::BaseModel
- Retab::ExtractionRequest
- Defined in:
- lib/retab/extractions/extraction_request.rb
Constant Summary collapse
- HASH_ATTRS =
{ document: :document, json_schema: :json_schema, model: :model, image_resolution_dpi: :image_resolution_dpi, instructions: :instructions, n_consensus: :n_consensus, metadata: :metadata, additional_messages: :additional_messages, bust_cache: :bust_cache, stream: :stream }.freeze
Instance Attribute Summary collapse
-
#additional_messages ⇒ Object
Returns the value of attribute additional_messages.
-
#bust_cache ⇒ Object
Returns the value of attribute bust_cache.
-
#document ⇒ Object
Returns the value of attribute document.
-
#image_resolution_dpi ⇒ Object
Returns the value of attribute image_resolution_dpi.
-
#instructions ⇒ Object
Returns the value of attribute instructions.
-
#json_schema ⇒ Object
Returns the value of attribute json_schema.
-
#metadata ⇒ Object
Returns the value of attribute metadata.
-
#model ⇒ Object
Returns the value of attribute model.
-
#n_consensus ⇒ Object
Returns the value of attribute n_consensus.
-
#stream ⇒ Object
Returns the value of attribute stream.
Attributes inherited from Types::BaseModel
Instance Method Summary collapse
-
#initialize(json) ⇒ ExtractionRequest
constructor
A new instance of ExtractionRequest.
Methods inherited from Types::BaseModel
#inspect, normalize, #to_h, #to_json
Constructor Details
#initialize(json) ⇒ ExtractionRequest
Returns a new instance of ExtractionRequest.
33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/retab/extractions/extraction_request.rb', line 33 def initialize(json) hash = self.class.normalize(json) @document = hash[:document] ? Retab::MimeData.new(hash[:document]) : nil @json_schema = hash[:json_schema] || {} @model = hash[:model] @image_resolution_dpi = hash[:image_resolution_dpi] @instructions = hash[:instructions] @n_consensus = hash[:n_consensus] @metadata = hash[:metadata] || {} @additional_messages = (hash[:additional_messages] || []).map { |item| item || {} } @bust_cache = hash[:bust_cache] @stream = hash[:stream] end |
Instance Attribute Details
#additional_messages ⇒ Object
Returns the value of attribute additional_messages.
21 22 23 |
# File 'lib/retab/extractions/extraction_request.rb', line 21 def @additional_messages end |
#bust_cache ⇒ Object
Returns the value of attribute bust_cache.
21 22 23 |
# File 'lib/retab/extractions/extraction_request.rb', line 21 def bust_cache @bust_cache end |
#document ⇒ Object
Returns the value of attribute document.
21 22 23 |
# File 'lib/retab/extractions/extraction_request.rb', line 21 def document @document end |
#image_resolution_dpi ⇒ Object
Returns the value of attribute image_resolution_dpi.
21 22 23 |
# File 'lib/retab/extractions/extraction_request.rb', line 21 def image_resolution_dpi @image_resolution_dpi end |
#instructions ⇒ Object
Returns the value of attribute instructions.
21 22 23 |
# File 'lib/retab/extractions/extraction_request.rb', line 21 def instructions @instructions end |
#json_schema ⇒ Object
Returns the value of attribute json_schema.
21 22 23 |
# File 'lib/retab/extractions/extraction_request.rb', line 21 def json_schema @json_schema end |
#metadata ⇒ Object
Returns the value of attribute metadata.
21 22 23 |
# File 'lib/retab/extractions/extraction_request.rb', line 21 def @metadata end |
#model ⇒ Object
Returns the value of attribute model.
21 22 23 |
# File 'lib/retab/extractions/extraction_request.rb', line 21 def model @model end |
#n_consensus ⇒ Object
Returns the value of attribute n_consensus.
21 22 23 |
# File 'lib/retab/extractions/extraction_request.rb', line 21 def n_consensus @n_consensus end |
#stream ⇒ Object
Returns the value of attribute stream.
21 22 23 |
# File 'lib/retab/extractions/extraction_request.rb', line 21 def stream @stream end |