Class: AmazonTRP::Geometry

Inherits:
Object
  • Object
show all
Defined in:
lib/amazon-textract-parser-ruby.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#boundingBoxObject (readonly)

Returns the value of attribute boundingBox.



54
55
56
# File 'lib/amazon-textract-parser-ruby.rb', line 54

def boundingBox
  @boundingBox
end

#polygonObject (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_sObject



64
65
66
# File 'lib/amazon-textract-parser-ruby.rb', line 64

def to_s
  "BoundingBox: #{@bounding_box}"
end