Class: Retab::BBox

Inherits:
Types::BaseModel show all
Defined in:
lib/retab/workflow_artifacts/b_box.rb

Constant Summary collapse

HASH_ATTRS =
{
  left: :left,
  top: :top,
  width: :width,
  height: :height,
  page: :page
}.freeze

Instance Attribute Summary collapse

Attributes inherited from Types::BaseModel

#last_response

Instance Method Summary collapse

Methods inherited from Types::BaseModel

#inspect, normalize, #to_h, #to_json

Constructor Details

#initialize(json) ⇒ BBox

Returns a new instance of BBox.



23
24
25
26
27
28
29
30
# File 'lib/retab/workflow_artifacts/b_box.rb', line 23

def initialize(json)
  hash = self.class.normalize(json)
  @left = hash[:left]
  @top = hash[:top]
  @width = hash[:width]
  @height = hash[:height]
  @page = hash[:page]
end

Instance Attribute Details

#heightObject

Returns the value of attribute height.



16
17
18
# File 'lib/retab/workflow_artifacts/b_box.rb', line 16

def height
  @height
end

#leftObject

Returns the value of attribute left.



16
17
18
# File 'lib/retab/workflow_artifacts/b_box.rb', line 16

def left
  @left
end

#pageObject

Returns the value of attribute page.



16
17
18
# File 'lib/retab/workflow_artifacts/b_box.rb', line 16

def page
  @page
end

#topObject

Returns the value of attribute top.



16
17
18
# File 'lib/retab/workflow_artifacts/b_box.rb', line 16

def top
  @top
end

#widthObject

Returns the value of attribute width.



16
17
18
# File 'lib/retab/workflow_artifacts/b_box.rb', line 16

def width
  @width
end