Sha256: ec98d3dab191e21b6ff235774c0f16d7f5635ecf5d4de19c7d7d54ffe1fbcf52
Contents?: true
Size: 626 Bytes
Versions: 32
Compression:
Stored size: 626 Bytes
Contents
class Puppeteer::ElementHandle < Puppeteer::JSHandle # A class to represent (x, y)-coordinates # supporting + and / operators. class Point def initialize(x:, y:) @x = x @y = y end def +(other) Point.new( x: @x + other.x, y: @y + other.y, ) end def /(num) Point.new( x: @x / num, y: @y / num, ) end def ==(other) case other when Hash @x == other[:x] && @y == other[:y] when Point @x == other.x && @y == other.y else super end end attr_reader :x, :y end end
Version data entries
32 entries across 32 versions & 1 rubygems