Class: Applitools::Appium::Screenshot
- Inherits:
-
EyesScreenshot
- Object
- EyesScreenshot
- Applitools::Appium::Screenshot
- Defined in:
- lib/applitools/appium/screenshot.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#device_pixel_ratio ⇒ Object
readonly
Returns the value of attribute device_pixel_ratio.
-
#status_bar_height ⇒ Object
readonly
Returns the value of attribute status_bar_height.
Instance Method Summary collapse
- #convert_location(location, _from, _to) ⇒ Object
-
#initialize(*args) ⇒ Screenshot
constructor
A new instance of Screenshot.
- #sub_screenshot(region, _coordinate_type, _throw_if_clipped = false, _force_nil_if_clipped = false) ⇒ Object
Constructor Details
#initialize(*args) ⇒ Screenshot
Returns a new instance of Screenshot.
9 10 11 12 13 14 |
# File 'lib/applitools/appium/screenshot.rb', line 9 def initialize(*args) = Applitools::Utils.(args) @status_bar_height = [:status_bar_height] || 0 @device_pixel_ratio = [:device_pixel_ratio] || 1 super end |
Instance Attribute Details
#device_pixel_ratio ⇒ Object (readonly)
Returns the value of attribute device_pixel_ratio.
7 8 9 |
# File 'lib/applitools/appium/screenshot.rb', line 7 def device_pixel_ratio @device_pixel_ratio end |
#status_bar_height ⇒ Object (readonly)
Returns the value of attribute status_bar_height.
7 8 9 |
# File 'lib/applitools/appium/screenshot.rb', line 7 def @status_bar_height end |
Instance Method Details
#convert_location(location, _from, _to) ⇒ Object
24 25 26 27 |
# File 'lib/applitools/appium/screenshot.rb', line 24 def convert_location(location, _from, _to) raise 'Applitools::Appium::Screenshot is an abstract class.' \ ' You should implement :convert_location method in a descendant class.' end |
#sub_screenshot(region, _coordinate_type, _throw_if_clipped = false, _force_nil_if_clipped = false) ⇒ Object
16 17 18 19 20 21 22 |
# File 'lib/applitools/appium/screenshot.rb', line 16 def sub_screenshot(region, _coordinate_type, _throw_if_clipped = false, _force_nil_if_clipped = false) self.class.new( Applitools::Screenshot.from_image( image.crop(region.x, region.y, region.width, region.height) ) ) end |