Class: Applitools::FloatingRegion
- Defined in:
- lib/applitools/core/floating_region.rb
Constant Summary
Constants inherited from Region
Instance Attribute Summary collapse
-
#max_bottom_offset ⇒ Object
Returns the value of attribute max_bottom_offset.
-
#max_left_offset ⇒ Object
Returns the value of attribute max_left_offset.
-
#max_right_offset ⇒ Object
Returns the value of attribute max_right_offset.
-
#max_top_offset ⇒ Object
Returns the value of attribute max_top_offset.
Attributes inherited from Region
Class Method Summary collapse
- .for_element(element, max_left_offset, max_top_offset, max_right_offset, max_bottom_offset) ⇒ Object
Instance Method Summary collapse
-
#initialize(left, top, width, height, max_left_offset, max_top_offset, max_right_offset, max_bottom_offset) ⇒ FloatingRegion
constructor
A new instance of FloatingRegion.
- #to_hash ⇒ Object
Methods inherited from Region
#bottom, #contains?, #empty?, from_location_size, #intersect, #intersecting?, #location, #location=, #make_empty, #middle_offset, #right, #size, #size_equals?, #sub_regions, sub_regions_with_fixed_size, sub_regions_with_varying_size, #to_s
Constructor Details
#initialize(left, top, width, height, max_left_offset, max_top_offset, max_right_offset, max_bottom_offset) ⇒ FloatingRegion
Returns a new instance of FloatingRegion.
14 15 16 17 18 19 20 |
# File 'lib/applitools/core/floating_region.rb', line 14 def initialize(left, top, width, height, max_left_offset, max_top_offset, max_right_offset, max_bottom_offset) super(left, top, width, height) self.max_left_offset = max_left_offset self.max_top_offset = max_top_offset self.max_right_offset = max_right_offset self.max_bottom_offset = max_bottom_offset end |
Instance Attribute Details
#max_bottom_offset ⇒ Object
Returns the value of attribute max_bottom_offset.
12 13 14 |
# File 'lib/applitools/core/floating_region.rb', line 12 def max_bottom_offset @max_bottom_offset end |
#max_left_offset ⇒ Object
Returns the value of attribute max_left_offset.
12 13 14 |
# File 'lib/applitools/core/floating_region.rb', line 12 def max_left_offset @max_left_offset end |
#max_right_offset ⇒ Object
Returns the value of attribute max_right_offset.
12 13 14 |
# File 'lib/applitools/core/floating_region.rb', line 12 def max_right_offset @max_right_offset end |
#max_top_offset ⇒ Object
Returns the value of attribute max_top_offset.
12 13 14 |
# File 'lib/applitools/core/floating_region.rb', line 12 def max_top_offset @max_top_offset end |
Class Method Details
.for_element(element, max_left_offset, max_top_offset, max_right_offset, max_bottom_offset) ⇒ Object
5 6 7 8 9 |
# File 'lib/applitools/core/floating_region.rb', line 5 def for_element(element, max_left_offset, max_top_offset, max_right_offset, max_bottom_offset) Applitools::ArgumentGuard.is_a? element, 'element', Applitools::Selenium::Element new element.location.x, element.location.y, element.size.width, element.size.height, max_left_offset, max_top_offset, max_right_offset, max_bottom_offset end |
Instance Method Details
#to_hash ⇒ Object
22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/applitools/core/floating_region.rb', line 22 def to_hash { 'Top' => top, 'Left' => left, 'Width' => width, 'Height' => height, 'MaxUpOffset' => max_top_offset, 'MaxLeftOffset' => max_left_offset, 'MaxRightOffset' => max_right_offset, 'MaxDownOffset' => max_bottom_offset } end |