Class: Retab::ClassificationRequest
- Inherits:
-
Types::BaseModel
- Object
- Types::BaseModel
- Retab::ClassificationRequest
- Defined in:
- lib/retab/classifications/classification_request.rb
Constant Summary collapse
- HASH_ATTRS =
{ document: :document, categories: :categories, model: :model, first_n_pages: :first_n_pages, instructions: :instructions, n_consensus: :n_consensus, bust_cache: :bust_cache }.freeze
Instance Attribute Summary collapse
-
#bust_cache ⇒ Object
Returns the value of attribute bust_cache.
-
#categories ⇒ Object
Returns the value of attribute categories.
-
#document ⇒ Object
Returns the value of attribute document.
-
#first_n_pages ⇒ Object
Returns the value of attribute first_n_pages.
-
#instructions ⇒ Object
Returns the value of attribute instructions.
-
#model ⇒ Object
Returns the value of attribute model.
-
#n_consensus ⇒ Object
Returns the value of attribute n_consensus.
Attributes inherited from Types::BaseModel
Instance Method Summary collapse
-
#initialize(json) ⇒ ClassificationRequest
constructor
A new instance of ClassificationRequest.
Methods inherited from Types::BaseModel
#inspect, normalize, #to_h, #to_json
Constructor Details
#initialize(json) ⇒ ClassificationRequest
Returns a new instance of ClassificationRequest.
27 28 29 30 31 32 33 34 35 36 |
# File 'lib/retab/classifications/classification_request.rb', line 27 def initialize(json) hash = self.class.normalize(json) @document = hash[:document] ? Retab::MimeData.new(hash[:document]) : nil @categories = (hash[:categories] || []).map { |item| item ? Retab::Category.new(item) : nil } @model = hash[:model] @first_n_pages = hash[:first_n_pages] @instructions = hash[:instructions] @n_consensus = hash[:n_consensus] @bust_cache = hash[:bust_cache] end |
Instance Attribute Details
#bust_cache ⇒ Object
Returns the value of attribute bust_cache.
18 19 20 |
# File 'lib/retab/classifications/classification_request.rb', line 18 def bust_cache @bust_cache end |
#categories ⇒ Object
Returns the value of attribute categories.
18 19 20 |
# File 'lib/retab/classifications/classification_request.rb', line 18 def categories @categories end |
#document ⇒ Object
Returns the value of attribute document.
18 19 20 |
# File 'lib/retab/classifications/classification_request.rb', line 18 def document @document end |
#first_n_pages ⇒ Object
Returns the value of attribute first_n_pages.
18 19 20 |
# File 'lib/retab/classifications/classification_request.rb', line 18 def first_n_pages @first_n_pages end |
#instructions ⇒ Object
Returns the value of attribute instructions.
18 19 20 |
# File 'lib/retab/classifications/classification_request.rb', line 18 def instructions @instructions end |
#model ⇒ Object
Returns the value of attribute model.
18 19 20 |
# File 'lib/retab/classifications/classification_request.rb', line 18 def model @model end |
#n_consensus ⇒ Object
Returns the value of attribute n_consensus.
18 19 20 |
# File 'lib/retab/classifications/classification_request.rb', line 18 def n_consensus @n_consensus end |