Class: Mindee::Product::Passport::PassportV1
- Inherits:
-
Mindee::Parsing::Common::Inference
- Object
- Mindee::Parsing::Common::Inference
- Mindee::Product::Passport::PassportV1
- Defined in:
- lib/mindee/product/passport/passport_v1.rb
Overview
Passport API version 1 inference prediction.
Class Attribute Summary collapse
-
.endpoint_name ⇒ String
readonly
Name of the endpoint for this product.
-
.endpoint_version ⇒ String
readonly
Version for this product.
Attributes inherited from Mindee::Parsing::Common::Inference
#is_rotation_applied, #pages, #prediction, #product
Instance Method Summary collapse
-
#initialize(prediction) ⇒ PassportV1
constructor
A new instance of PassportV1.
Methods inherited from Mindee::Parsing::Common::Inference
Constructor Details
#initialize(prediction) ⇒ PassportV1
Returns a new instance of PassportV1.
17 18 19 20 21 22 23 24 25 26 |
# File 'lib/mindee/product/passport/passport_v1.rb', line 17 def initialize(prediction) super @prediction = PassportV1Document.new(prediction['prediction'], nil) @pages = [] prediction['pages'].each do |page| if page.key?('prediction') && !page['prediction'].nil? && !page['prediction'].empty? @pages.push(PassportV1Page.new(page)) end end end |
Class Attribute Details
.endpoint_name ⇒ String (readonly)
Name of the endpoint for this product.
31 32 33 |
# File 'lib/mindee/product/passport/passport_v1.rb', line 31 def endpoint_name @endpoint_name end |
.endpoint_version ⇒ String (readonly)
Version for this product.
34 35 36 |
# File 'lib/mindee/product/passport/passport_v1.rb', line 34 def endpoint_version @endpoint_version end |