Class: Kreuzberg::Result::OcrRotation

Inherits:
Object
  • Object
show all
Defined in:
lib/kreuzberg/result.rb

Overview

OCR rotation information

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(angle_degrees: nil, confidence: nil) ⇒ OcrRotation

Returns a new instance of OcrRotation.



288
289
290
291
# File 'lib/kreuzberg/result.rb', line 288

def initialize(angle_degrees: nil, confidence: nil)
  @angle_degrees = angle_degrees&.to_f
  @confidence = confidence&.to_f
end

Instance Attribute Details

#angle_degreesObject (readonly)

Returns the value of attribute angle_degrees.



286
287
288
# File 'lib/kreuzberg/result.rb', line 286

def angle_degrees
  @angle_degrees
end

#confidenceObject (readonly)

Returns the value of attribute confidence.



286
287
288
# File 'lib/kreuzberg/result.rb', line 286

def confidence
  @confidence
end

Instance Method Details

#to_hObject



293
294
295
296
297
298
# File 'lib/kreuzberg/result.rb', line 293

def to_h
  {
    angle_degrees: @angle_degrees,
    confidence: @confidence
  }.compact
end