Class: TestaAppiumDriver::Offset
- Inherits:
-
Object
- Object
- TestaAppiumDriver::Offset
- Defined in:
- lib/testa_appium_driver/common/bounds.rb
Instance Method Summary collapse
- #as_json ⇒ Object
- #bottom ⇒ Integer
-
#initialize(bounds, window_width, window_height) ⇒ Offset
constructor
A new instance of Offset.
- #left ⇒ Integer
- #right ⇒ Integer
- #top ⇒ Integer
Constructor Details
#initialize(bounds, window_width, window_height) ⇒ Offset
Returns a new instance of Offset.
114 115 116 117 118 119 |
# File 'lib/testa_appium_driver/common/bounds.rb', line 114 def initialize(bounds, window_width, window_height) @top = bounds.top_left.y @right = window_width - bounds.bottom_right.x @bottom = window_height - bounds.bottom_right.y @left = bounds.top_left.x end |
Instance Method Details
#as_json ⇒ Object
121 122 123 124 125 126 127 128 |
# File 'lib/testa_appium_driver/common/bounds.rb', line 121 def as_json { top: @top, right: @right, bottom: @bottom, left: @left } end |
#bottom ⇒ Integer
141 142 143 |
# File 'lib/testa_appium_driver/common/bounds.rb', line 141 def bottom @bottom end |
#left ⇒ Integer
146 147 148 |
# File 'lib/testa_appium_driver/common/bounds.rb', line 146 def left @left end |
#right ⇒ Integer
136 137 138 |
# File 'lib/testa_appium_driver/common/bounds.rb', line 136 def right @right end |
#top ⇒ Integer
131 132 133 |
# File 'lib/testa_appium_driver/common/bounds.rb', line 131 def top @top end |