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.



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

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

Instance Attribute Details

#xObject (readonly)

Returns the value of attribute x.



83
84
85
# File 'lib/puppeteer/element_handle.rb', line 83

def x
  @x
end

#yObject (readonly)

Returns the value of attribute y.



83
84
85
# File 'lib/puppeteer/element_handle.rb', line 83

def y
  @y
end

Instance Method Details

#+(other) ⇒ Object



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

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

#/(num) ⇒ Object



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

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