Class: Applitools::Region
- Inherits:
-
Object
- Object
- Applitools::Region
- Defined in:
- lib/eyes_selenium_ruby/eyes/region.rb
Instance Attribute Summary collapse
-
#height ⇒ Object
Returns the value of attribute height.
-
#left ⇒ Object
Returns the value of attribute left.
-
#top ⇒ Object
Returns the value of attribute top.
-
#width ⇒ Object
Returns the value of attribute width.
Instance Method Summary collapse
-
#initialize(left, top, height, width) ⇒ Region
constructor
A new instance of Region.
- #middle_offset ⇒ Object
- #to_hash ⇒ Object
Constructor Details
#initialize(left, top, height, width) ⇒ Region
Returns a new instance of Region.
4 5 6 7 8 9 |
# File 'lib/eyes_selenium_ruby/eyes/region.rb', line 4 def initialize(left, top, height, width) @left = left @top = top @height = height @width = width end |
Instance Attribute Details
#height ⇒ Object
Returns the value of attribute height.
2 3 4 |
# File 'lib/eyes_selenium_ruby/eyes/region.rb', line 2 def height @height end |
#left ⇒ Object
Returns the value of attribute left.
2 3 4 |
# File 'lib/eyes_selenium_ruby/eyes/region.rb', line 2 def left @left end |
#top ⇒ Object
Returns the value of attribute top.
2 3 4 |
# File 'lib/eyes_selenium_ruby/eyes/region.rb', line 2 def top @top end |
#width ⇒ Object
Returns the value of attribute width.
2 3 4 |
# File 'lib/eyes_selenium_ruby/eyes/region.rb', line 2 def width @width end |
Instance Method Details
#middle_offset ⇒ Object
11 12 13 14 15 |
# File 'lib/eyes_selenium_ruby/eyes/region.rb', line 11 def middle_offset mid_x = width / 2 mid_y = height / 2 Selenium::WebDriver::Location.new mid_x, mid_y end |
#to_hash ⇒ Object
17 18 19 20 21 |
# File 'lib/eyes_selenium_ruby/eyes/region.rb', line 17 def to_hash { "$type" => "Applitools.Utils.Geometry.MutableRegion, Core", left: left, top: top, height: height, width: width } end |