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.


110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
# File 'lib/applitools/core/floating_region.rb', line 110

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


109
110
111
# File 'lib/applitools/core/floating_region.rb', line 109

def max_bottom_offset
  @max_bottom_offset
end

#max_left_offsetObject

Returns the value of attribute max_left_offset


109
110
111
# File 'lib/applitools/core/floating_region.rb', line 109

def max_left_offset
  @max_left_offset
end

#max_right_offsetObject

Returns the value of attribute max_right_offset


109
110
111
# File 'lib/applitools/core/floating_region.rb', line 109

def max_right_offset
  @max_right_offset
end

#max_top_offsetObject

Returns the value of attribute max_top_offset


109
110
111
# File 'lib/applitools/core/floating_region.rb', line 109

def max_top_offset
  @max_top_offset
end