Class: Puppeteer::ElementHandle::Point

Inherits:
Object
  • Object
show all
Defined in:
lib/puppeteer/element_handle.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(x:, y:) ⇒ Point

Returns a new instance of Point.



57
58
59
60
# File 'lib/puppeteer/element_handle.rb', line 57

def initialize(x:, y:)
  @x = x
  @y = y
end

Instance Attribute Details

#xObject (readonly)

Returns the value of attribute x.



76
77
78
# File 'lib/puppeteer/element_handle.rb', line 76

def x
  @x
end

#yObject (readonly)

Returns the value of attribute y.



76
77
78
# File 'lib/puppeteer/element_handle.rb', line 76

def y
  @y
end

Instance Method Details

#+(other) ⇒ Object



62
63
64
65
66
67
# File 'lib/puppeteer/element_handle.rb', line 62

def +(other)
  Point.new(
    x: @x + other.x,
    y: @y + other.y,
  )
end

#/(num) ⇒ Object



69
70
71
72
73
74
# File 'lib/puppeteer/element_handle.rb', line 69

def /(num)
  Point.new(
    x: @x / num,
    y: @y / num,
  )
end