Class: OmniAI::Mistral::OCR::Dimensions

Inherits:
Object
  • Object
show all
Defined in:
lib/omniai/mistral/ocr/dimensions.rb

Overview

Dimensions returned by the OCR API.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(width:, height:, dpi:) ⇒ Dimensions

Returns a new instance of Dimensions.

Parameters:

  • width (Integer)
  • height (Integer)
  • dpi (Integer)


23
24
25
26
27
# File 'lib/omniai/mistral/ocr/dimensions.rb', line 23

def initialize(width:, height:, dpi:)
  @width = width
  @height = height
  @dpi = dpi
end

Instance Attribute Details

#dpiObject

!@attribute [rw] dpi

@return [Integer]


18
19
20
# File 'lib/omniai/mistral/ocr/dimensions.rb', line 18

def dpi
  @dpi
end

#heightObject

!@attribute [rw] height

@return [Integer]


14
15
16
# File 'lib/omniai/mistral/ocr/dimensions.rb', line 14

def height
  @height
end

#widthObject

!@attribute [rw] width

@return [Integer]


10
11
12
# File 'lib/omniai/mistral/ocr/dimensions.rb', line 10

def width
  @width
end

Class Method Details

.parse(data:) ⇒ Dimensions

Parameters:

  • data (Hash)

Returns:



32
33
34
# File 'lib/omniai/mistral/ocr/dimensions.rb', line 32

def self.parse(data:)
  new(width: data["width"], height: data["height"], dpi: data["dpi"])
end