Class: Gitlab::Diff::ImagePoint

Inherits:
Object
  • Object
show all
Defined in:
lib/gitlab/diff/image_point.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#heightObject (readonly)

Returns the value of attribute height


6
7
8
# File 'lib/gitlab/diff/image_point.rb', line 6

def height
  @height
end

#widthObject (readonly)

Returns the value of attribute width


6
7
8
# File 'lib/gitlab/diff/image_point.rb', line 6

def width
  @width
end

#xObject (readonly)

Returns the value of attribute x


6
7
8
# File 'lib/gitlab/diff/image_point.rb', line 6

def x
  @x
end

#yObject (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_hObject


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