Class: Applitools::Base::Dimension
- Inherits:
-
Struct
- Object
- Struct
- Applitools::Base::Dimension
- Defined in:
- lib/applitools/base/dimension.rb
Instance Attribute Summary collapse
-
#height ⇒ Object
Returns the value of attribute height.
-
#width ⇒ Object
Returns the value of attribute width.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#height ⇒ Object
Returns the value of attribute height
2 3 4 |
# File 'lib/applitools/base/dimension.rb', line 2 def height @height end |
#width ⇒ Object
Returns the value of attribute width
2 3 4 |
# File 'lib/applitools/base/dimension.rb', line 2 def width @width end |
Class Method Details
.for(other) ⇒ Object
31 32 33 |
# File 'lib/applitools/base/dimension.rb', line 31 def for(other) new(other.width, other.height) end |
Instance Method Details
#+(other) ⇒ Object
20 21 22 23 24 |
# File 'lib/applitools/base/dimension.rb', line 20 def +(other) self.width += other.width self.height += other.height self end |
#-(other) ⇒ Object
14 15 16 17 18 |
# File 'lib/applitools/base/dimension.rb', line 14 def -(other) self.width -= other.width self.height -= other.height self end |
#to_hash ⇒ Object
3 4 5 6 7 8 |
# File 'lib/applitools/base/dimension.rb', line 3 def to_hash { width: width, height: height } end |
#to_s ⇒ Object
26 27 28 |
# File 'lib/applitools/base/dimension.rb', line 26 def to_s values.to_s end |
#values ⇒ Object
10 11 12 |
# File 'lib/applitools/base/dimension.rb', line 10 def values [width, height] end |