Class: AmazonTRP::Geometry
- Inherits:
-
Object
- Object
- AmazonTRP::Geometry
- Defined in:
- lib/amazon-textract-parser-ruby.rb
Instance Attribute Summary collapse
-
#boundingBox ⇒ Object
readonly
Returns the value of attribute boundingBox.
-
#polygon ⇒ Object
readonly
Returns the value of attribute polygon.
Instance Method Summary collapse
-
#initialize(geometry) ⇒ Geometry
constructor
A new instance of Geometry.
- #to_s ⇒ Object
Constructor Details
#initialize(geometry) ⇒ Geometry
Returns a new instance of Geometry.
57 58 59 60 61 62 |
# File 'lib/amazon-textract-parser-ruby.rb', line 57 def initialize(geometry) bbox = geometry[:bounding_box] pg = geometry[:polygon] @boundingBox = BoundingBox.new(bbox[:width], bbox[:height], bbox[:left], bbox[:top]) @polygon = pg.map{|p| Point.new(p[:x], p[:y])} end |
Instance Attribute Details
#boundingBox ⇒ Object (readonly)
Returns the value of attribute boundingBox.
54 55 56 |
# File 'lib/amazon-textract-parser-ruby.rb', line 54 def boundingBox @boundingBox end |
#polygon ⇒ Object (readonly)
Returns the value of attribute polygon.
55 56 57 |
# File 'lib/amazon-textract-parser-ruby.rb', line 55 def polygon @polygon end |
Instance Method Details
#to_s ⇒ Object
64 65 66 |
# File 'lib/amazon-textract-parser-ruby.rb', line 64 def to_s "BoundingBox: #{@bounding_box}" end |