Class: Gitlab::Diff::ImagePoint
- Inherits:
-
Object
- Object
- Gitlab::Diff::ImagePoint
- Defined in:
- lib/gitlab/diff/image_point.rb
Instance Attribute Summary collapse
-
#height ⇒ Object
readonly
Returns the value of attribute height.
-
#width ⇒ Object
readonly
Returns the value of attribute width.
-
#x ⇒ Object
readonly
Returns the value of attribute x.
-
#y ⇒ Object
readonly
Returns the value of attribute y.
Instance Method Summary collapse
-
#initialize(width, height, new_x, new_y) ⇒ ImagePoint
constructor
A new instance of ImagePoint.
- #to_h ⇒ Object
Constructor Details
#initialize(width, height, new_x, new_y) ⇒ ImagePoint
Returns a new instance of ImagePoint.
8 9 10 11 12 13 |
# File 'lib/gitlab/diff/image_point.rb', line 8 def initialize(width, height, new_x, new_y) @width = width @height = height @x = new_x @y = new_y end |
Instance Attribute Details
#height ⇒ Object (readonly)
Returns the value of attribute height.
6 7 8 |
# File 'lib/gitlab/diff/image_point.rb', line 6 def height @height end |
#width ⇒ Object (readonly)
Returns the value of attribute width.
6 7 8 |
# File 'lib/gitlab/diff/image_point.rb', line 6 def width @width end |
#x ⇒ Object (readonly)
Returns the value of attribute x.
6 7 8 |
# File 'lib/gitlab/diff/image_point.rb', line 6 def x @x end |
#y ⇒ Object (readonly)
Returns the value of attribute y.
6 7 8 |
# File 'lib/gitlab/diff/image_point.rb', line 6 def y @y end |
Instance Method Details
#to_h ⇒ Object
15 16 17 18 19 20 21 22 |
# File 'lib/gitlab/diff/image_point.rb', line 15 def to_h { width: width, height: height, x: x, y: y } end |