class WebkitRemote::Client::JsProperty

A property of a remote JavaScript object.

Attributes

configurable[R]

@return [Boolean] true if JavaScript code can remove this property

configurable?[R]

@return [Boolean] true if JavaScript code can remove this property

enumerable[R]

@return [Boolean] true if JavaScript code can enumerate this property

enumerable?[R]

@return [Boolean] true if JavaScript code can enumerate this property

name[R]

@return [String] the property's name

owner[R]

@return [WebkitRemote::JsObject] the object that this property belongs

to
value[R]

@return [WebkitRemote::Client::JsObject, Boolean, Number, String, nil]

a Ruby wrapper for the property's value; primitives get wrapped by
standard Ruby classes, and objects get wrapped by JsObject
instances
writable[R]

@return [Boolean] true if JavaScript code can change this property's value

writable?[R]

@return [Boolean] true if JavaScript code can change this property's value

Public Class Methods

new(raw_property, owner) click to toggle source

@param [Hash<String, Object>] raw_property a PropertyDescriptor instance,

according to the Webkit remote debugging protocol; this is an item in
the array returned by the 'Runtime.getProperties' RPC call

@param [WebkitRemote::Client::JsObject] owner the object that this

property belongs to
# File lib/webkit_remote/client/runtime.rb, line 477
def initialize(raw_property, owner)
  # NOTE: these are only used at construction time
  client = owner.client
  group_name = owner.group.name

  @owner = owner
  @name = raw_property['name']
  @configurable = !!raw_property['configurable']
  @enumerable = !!raw_property['enumerable']
  @writable = !!raw_property['writable']
  @js_getter = raw_property['get'] && WebkitRemote::Client::JsObject.for(
      raw_property['get'], client, group_name)
  @js_setter = raw_property['set'] && WebkitRemote::Client::JsObject.for(
      raw_property['set'], client, group_name)
  @value = raw_property['value'] && WebkitRemote::Client::JsObject.for(
      raw_property['value'], client, group_name)
end

Public Instance Methods

inspect() click to toggle source

Debugging output.

# File lib/webkit_remote/client/runtime.rb, line 496
def inspect
  result = self.to_s
  result[-1, 0] =
      " name=#{@name.inspect} configurable=#{@configurable} " +
      "enumerable=#{@enumerable} writable=#{@writable}"
  result
end