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



98
99
100
101
# File 'lib/webkit_remote_unstable/dom.rb', line 98

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



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

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



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

def y
  @y
end