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.
246 247 248 249 250 251 252 253 |
# File 'lib/kreuzberg/result.rb', line 246 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.
244 245 246 |
# File 'lib/kreuzberg/result.rb', line 244 def height @height end |
#left ⇒ Object (readonly)
Returns the value of attribute left.
244 245 246 |
# File 'lib/kreuzberg/result.rb', line 244 def left @left end |
#points ⇒ Object (readonly)
Returns the value of attribute points.
244 245 246 |
# File 'lib/kreuzberg/result.rb', line 244 def points @points end |
#top ⇒ Object (readonly)
Returns the value of attribute top.
244 245 246 |
# File 'lib/kreuzberg/result.rb', line 244 def top @top end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
244 245 246 |
# File 'lib/kreuzberg/result.rb', line 244 def type @type end |
#width ⇒ Object (readonly)
Returns the value of attribute width.
244 245 246 |
# File 'lib/kreuzberg/result.rb', line 244 def width @width end |
Instance Method Details
#to_h ⇒ Object
255 256 257 258 259 260 261 262 263 264 |
# File 'lib/kreuzberg/result.rb', line 255 def to_h { type: @type, left: @left, top: @top, width: @width, height: @height, points: @points }.compact end |