Class: Applitools::FloatingBounds

Inherits:
Object
  • Object
show all
Defined in:
lib/applitools/core/floating_region.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(max_left_offset, max_top_offset, max_right_offset, max_bottom_offset) ⇒ FloatingBounds

Returns a new instance of FloatingBounds.



100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
# File 'lib/applitools/core/floating_region.rb', line 100

def initialize(max_left_offset, max_top_offset, max_right_offset, max_bottom_offset)
  Applitools::ArgumentGuard.is_a?(max_left_offset, 'max_left_offset', Integer)
  Applitools::ArgumentGuard.is_a?(max_top_offset, 'max_top_offset', Integer)
  Applitools::ArgumentGuard.is_a?(max_right_offset, 'max_right_offset', Integer)
  Applitools::ArgumentGuard.is_a?(max_bottom_offset, 'max_bottom_offset', Integer)

  Applitools::ArgumentGuard.greater_than_or_equal_to_zero(max_left_offset, 'max_left_offset')
  Applitools::ArgumentGuard.greater_than_or_equal_to_zero(max_top_offset, 'max_top_offset')
  Applitools::ArgumentGuard.greater_than_or_equal_to_zero(max_right_offset, 'max_right_offset')
  Applitools::ArgumentGuard.greater_than_or_equal_to_zero(max_bottom_offset, 'max_bottom_offset')

  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_offsetObject

Returns the value of attribute max_bottom_offset.



99
100
101
# File 'lib/applitools/core/floating_region.rb', line 99

def max_bottom_offset
  @max_bottom_offset
end

#max_left_offsetObject

Returns the value of attribute max_left_offset.



99
100
101
# File 'lib/applitools/core/floating_region.rb', line 99

def max_left_offset
  @max_left_offset
end

#max_right_offsetObject

Returns the value of attribute max_right_offset.



99
100
101
# File 'lib/applitools/core/floating_region.rb', line 99

def max_right_offset
  @max_right_offset
end

#max_top_offsetObject

Returns the value of attribute max_top_offset.



99
100
101
# File 'lib/applitools/core/floating_region.rb', line 99

def max_top_offset
  @max_top_offset
end