Class: AmazonTRP::BoundingBox

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(width, height, left, top) ⇒ BoundingBox

Returns a new instance of BoundingBox.



17
18
19
20
21
22
# File 'lib/amazon-textract-parser-ruby.rb', line 17

def initialize(width, height, left, top)
  @width = width
  @height = height
  @left = left
  @top = top
end

Instance Attribute Details

#heightObject (readonly)

Returns the value of attribute height.



13
14
15
# File 'lib/amazon-textract-parser-ruby.rb', line 13

def height
  @height
end

#leftObject (readonly)

Returns the value of attribute left.



14
15
16
# File 'lib/amazon-textract-parser-ruby.rb', line 14

def left
  @left
end

#topObject (readonly)

Returns the value of attribute top.



15
16
17
# File 'lib/amazon-textract-parser-ruby.rb', line 15

def top
  @top
end

#widthObject (readonly)

Returns the value of attribute width.



12
13
14
# File 'lib/amazon-textract-parser-ruby.rb', line 12

def width
  @width
end

Instance Method Details

#bottomObject



32
33
34
# File 'lib/amazon-textract-parser-ruby.rb', line 32

def bottom
  @top + @height
end

#rightObject



28
29
30
# File 'lib/amazon-textract-parser-ruby.rb', line 28

def right
  @left + @width
end

#to_sObject



24
25
26
# File 'lib/amazon-textract-parser-ruby.rb', line 24

def to_s
  "width: #{@width}, height: #{@height}, left: #{@left}, top: #{@top}"
end