Class: Kreuzberg::Result::OcrBoundingGeometry
- Inherits:
-
Object
- Object
- Kreuzberg::Result::OcrBoundingGeometry
- Defined in:
- lib/kreuzberg/result.rb
Overview
OCR bounding geometry with type and coordinates
Instance Attribute Summary collapse
-
#height ⇒ Object
readonly
Returns the value of attribute height.
-
#left ⇒ Object
readonly
Returns the value of attribute left.
-
#points ⇒ Object
readonly
Returns the value of attribute points.
-
#top ⇒ Object
readonly
Returns the value of attribute top.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
-
#width ⇒ Object
readonly
Returns the value of attribute width.
Instance Method Summary collapse
-
#initialize(type:, left: nil, top: nil, width: nil, height: nil, points: nil) ⇒ OcrBoundingGeometry
constructor
A new instance of OcrBoundingGeometry.
- #to_h ⇒ Object
Constructor Details
#initialize(type:, left: nil, top: nil, width: nil, height: nil, points: nil) ⇒ OcrBoundingGeometry
Returns a new instance of OcrBoundingGeometry.
222 223 224 225 226 227 228 229 |
# File 'lib/kreuzberg/result.rb', line 222 def initialize(type:, left: nil, top: nil, width: nil, height: nil, points: nil) @type = type.to_s @left = left&.to_f @top = top&.to_f @width = width&.to_f @height = height&.to_f @points = points end |
Instance Attribute Details
#height ⇒ Object (readonly)
Returns the value of attribute height.
220 221 222 |
# File 'lib/kreuzberg/result.rb', line 220 def height @height end |
#left ⇒ Object (readonly)
Returns the value of attribute left.
220 221 222 |
# File 'lib/kreuzberg/result.rb', line 220 def left @left end |
#points ⇒ Object (readonly)
Returns the value of attribute points.
220 221 222 |
# File 'lib/kreuzberg/result.rb', line 220 def points @points end |
#top ⇒ Object (readonly)
Returns the value of attribute top.
220 221 222 |
# File 'lib/kreuzberg/result.rb', line 220 def top @top end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
220 221 222 |
# File 'lib/kreuzberg/result.rb', line 220 def type @type end |
#width ⇒ Object (readonly)
Returns the value of attribute width.
220 221 222 |
# File 'lib/kreuzberg/result.rb', line 220 def width @width end |
Instance Method Details
#to_h ⇒ Object
231 232 233 234 235 236 237 238 239 240 |
# File 'lib/kreuzberg/result.rb', line 231 def to_h { type: @type, left: @left, top: @top, width: @width, height: @height, points: @points }.compact end |