Class: OmniAI::Mistral::OCR::Image
- Inherits:
-
Object
- Object
- OmniAI::Mistral::OCR::Image
- Defined in:
- lib/omniai/mistral/ocr/image.rb
Overview
An image returned by the OCR API.
Instance Attribute Summary collapse
-
#bottom_right_x ⇒ Object
!@attribute [rw] bottom_right_x @return [Integer].
-
#bottom_right_y ⇒ Object
!@attribute [rw] bottom_right_y @return [Integer].
-
#id ⇒ Object
!@attribute [rw] id @return [Integer].
-
#image_base64 ⇒ Object
!@attribute [rw] image_base64 @return [String].
-
#top_left_x ⇒ Object
!@attribute [rw] top_left_x @return [Integer].
-
#top_left_y ⇒ Object
!@attribute [rw] top_left_y @return [Integer].
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(id:, top_left_x:, top_left_y:, bottom_right_x:, bottom_right_y:, image_base64:) ⇒ Image
constructor
A new instance of Image.
Constructor Details
#initialize(id:, top_left_x:, top_left_y:, bottom_right_x:, bottom_right_y:, image_base64:) ⇒ Image
Returns a new instance of Image.
38 39 40 41 42 43 44 45 |
# File 'lib/omniai/mistral/ocr/image.rb', line 38 def initialize(id:, top_left_x:, top_left_y:, bottom_right_x:, bottom_right_y:, image_base64:) @id = id @top_left_x = top_left_x @top_left_y = top_left_y @bottom_right_x = bottom_right_x @bottom_right_y = bottom_right_y @image_base64 = image_base64 end |
Instance Attribute Details
#bottom_right_x ⇒ Object
!@attribute [rw] bottom_right_x
@return [Integer]
22 23 24 |
# File 'lib/omniai/mistral/ocr/image.rb', line 22 def bottom_right_x @bottom_right_x end |
#bottom_right_y ⇒ Object
!@attribute [rw] bottom_right_y
@return [Integer]
26 27 28 |
# File 'lib/omniai/mistral/ocr/image.rb', line 26 def bottom_right_y @bottom_right_y end |
#id ⇒ Object
!@attribute [rw] id
@return [Integer]
10 11 12 |
# File 'lib/omniai/mistral/ocr/image.rb', line 10 def id @id end |
#image_base64 ⇒ Object
!@attribute [rw] image_base64
@return [String]
30 31 32 |
# File 'lib/omniai/mistral/ocr/image.rb', line 30 def image_base64 @image_base64 end |
#top_left_x ⇒ Object
!@attribute [rw] top_left_x
@return [Integer]
14 15 16 |
# File 'lib/omniai/mistral/ocr/image.rb', line 14 def top_left_x @top_left_x end |
#top_left_y ⇒ Object
!@attribute [rw] top_left_y
@return [Integer]
18 19 20 |
# File 'lib/omniai/mistral/ocr/image.rb', line 18 def top_left_y @top_left_y end |
Class Method Details
.parse(data:) ⇒ Image
50 51 52 53 54 55 56 57 58 59 |
# File 'lib/omniai/mistral/ocr/image.rb', line 50 def self.parse(data:) new( id: data["id"], top_left_x: data["top_left_x"], top_left_y: data["top_left_y"], bottom_right_x: data["bottom_right_x"], bottom_right_y: data["bottom_right_y"], image_base64: data["image_base64"] ) end |