Class: WebkitRemote::Client::DomQuad

Inherits:
Object
  • Object
show all
Defined in:
lib/webkit_remote_unstable/dom.rb

Overview

Coordinates for 4 points that make up a box’s boundary.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(raw_quad) ⇒ DomQuad

Wraps raw box model data received via a RPC call.

Parameters:

  • raw_quad (Array<Number>)

    a Quad instance, according to the Webkit remote debugging protocol



90
91
92
93
# File 'lib/webkit_remote_unstable/dom.rb', line 90

def initialize(raw_quad)
  @x = [raw_quad[0], raw_quad[2], raw_quad[4], raw_quad[6]].freeze
  @y = [raw_quad[1], raw_quad[3], raw_quad[5], raw_quad[7]].freeze
end

Instance Attribute Details

#xArray<Number> (readonly)

Returns x coordinates for the 4 points, in clockwise order.

Returns:

  • (Array<Number>)

    x coordinates for the 4 points, in clockwise order



81
82
83
# File 'lib/webkit_remote_unstable/dom.rb', line 81

def x
  @x
end

#yArray<Number> (readonly)

Returns y coordinates for the 4 points, in clockwise order.

Returns:

  • (Array<Number>)

    y coordinates for the 4 points, in clockwise order



84
85
86
# File 'lib/webkit_remote_unstable/dom.rb', line 84

def y
  @y
end