Class: Mindee::V1::Parsing::Common::Orientation

Inherits:
Object
  • Object
show all
Defined in:
lib/mindee/v1/parsing/common/orientation.rb

Overview

Page orientation

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(prediction, page_id) ⇒ Orientation

Returns a new instance of Orientation.

Parameters:

  • prediction (Hash)
  • page_id (Integer, nil)


20
21
22
23
# File 'lib/mindee/v1/parsing/common/orientation.rb', line 20

def initialize(prediction, page_id)
  @value = prediction['value']
  @page_id = page_id
end

Instance Attribute Details

#page_idInteger? (readonly)

Returns:

  • (Integer, nil)


10
11
12
# File 'lib/mindee/v1/parsing/common/orientation.rb', line 10

def page_id
  @page_id
end

#valueInteger? (readonly)

A prediction among these 3 possible outputs:

  • 0 degrees: the page is already upright
  • 90 degrees: the page must be rotated clockwise to be upright
  • 270 degrees: the page must be rotated counterclockwise to be upright

Returns:

  • (Integer, nil)


16
17
18
# File 'lib/mindee/v1/parsing/common/orientation.rb', line 16

def value
  @value
end