Class: Applitools::PaddingBounds

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

Constant Summary collapse

ZERO_PADDING =
PaddingBounds.new(0, 0, 0, 0).freeze
PIXEL_PADDING =
PaddingBounds.new(1, 1, 1, 1).freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(padding_left, padding_top, padding_right, padding_bottom) ⇒ PaddingBounds

Returns a new instance of PaddingBounds.



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/applitools/core/padding_bounds.rb', line 6

def initialize(padding_left, padding_top, padding_right, padding_bottom)
  Applitools::ArgumentGuard.is_a?(padding_left, 'padding_left', Integer)
  Applitools::ArgumentGuard.is_a?(padding_top, 'padding_top', Integer)
  Applitools::ArgumentGuard.is_a?(padding_right, 'padding_right', Integer)
  Applitools::ArgumentGuard.is_a?(padding_bottom, 'padding_bottom', Integer)

  Applitools::ArgumentGuard.greater_than_or_equal_to_zero(padding_left, 'padding_left')
  Applitools::ArgumentGuard.greater_than_or_equal_to_zero(padding_top, 'padding_top')
  Applitools::ArgumentGuard.greater_than_or_equal_to_zero(padding_right, 'padding_right')
  Applitools::ArgumentGuard.greater_than_or_equal_to_zero(padding_bottom, 'padding_bottom')

  self.padding_left = padding_left
  self.padding_top = padding_top
  self.padding_right = padding_right
  self.padding_bottom = padding_bottom
end

Instance Attribute Details

#padding_bottomObject

Returns the value of attribute padding_bottom.



5
6
7
# File 'lib/applitools/core/padding_bounds.rb', line 5

def padding_bottom
  @padding_bottom
end

#padding_leftObject

Returns the value of attribute padding_left.



5
6
7
# File 'lib/applitools/core/padding_bounds.rb', line 5

def padding_left
  @padding_left
end

#padding_rightObject

Returns the value of attribute padding_right.



5
6
7
# File 'lib/applitools/core/padding_bounds.rb', line 5

def padding_right
  @padding_right
end

#padding_topObject

Returns the value of attribute padding_top.



5
6
7
# File 'lib/applitools/core/padding_bounds.rb', line 5

def padding_top
  @padding_top
end