Class: WebkitRemote::Client::JsProperty

Inherits:
Object
  • Object
show all
Defined in:
lib/webkit_remote/client/runtime.rb

Overview

A property of a remote JavaScript object.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(raw_property, owner) ⇒ JsProperty



481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
# File 'lib/webkit_remote/client/runtime.rb', line 481

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

Instance Attribute Details

#configurableBoolean (readonly) Also known as: configurable?



461
462
463
# File 'lib/webkit_remote/client/runtime.rb', line 461

def configurable
  @configurable
end

#enumerableBoolean (readonly) Also known as: enumerable?



465
466
467
# File 'lib/webkit_remote/client/runtime.rb', line 465

def enumerable
  @enumerable
end

#nameString (readonly)



452
453
454
# File 'lib/webkit_remote/client/runtime.rb', line 452

def name
  @name
end

#ownerWebkitRemote::JsObject (readonly)



474
475
476
# File 'lib/webkit_remote/client/runtime.rb', line 474

def owner
  @owner
end

#valueWebkitRemote::Client::JsObject, ... (readonly)



458
459
460
# File 'lib/webkit_remote/client/runtime.rb', line 458

def value
  @value
end

#writableBoolean (readonly) Also known as: writable?



469
470
471
# File 'lib/webkit_remote/client/runtime.rb', line 469

def writable
  @writable
end

Instance Method Details

#inspectObject

Debugging output.



500
501
502
503
504
505
506
# File 'lib/webkit_remote/client/runtime.rb', line 500

def inspect
  result = self.to_s
  result[-1, 0] =
      " name=#{@name.inspect} configurable=#{@configurable} " +
      "enumerable=#{@enumerable} writable=#{@writable}"
  result
end