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.



268
269
270
271
# File 'lib/kreuzberg/result.rb', line 268

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.



266
267
268
# File 'lib/kreuzberg/result.rb', line 266

def angle_degrees
  @angle_degrees
end

#confidenceObject (readonly)

Returns the value of attribute confidence.



266
267
268
# File 'lib/kreuzberg/result.rb', line 266

def confidence
  @confidence
end

Instance Method Details

#to_hObject



273
274
275
276
277
278
# File 'lib/kreuzberg/result.rb', line 273

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