Class: WebkitRemote::Client::JsProperty
- Inherits:
-
Object
- Object
- WebkitRemote::Client::JsProperty
- Defined in:
- lib/webkit_remote/client/runtime.rb
Overview
A property of a remote JavaScript object.
Instance Attribute Summary collapse
-
#configurable ⇒ Boolean
(also: #configurable?)
readonly
True if JavaScript code can remove this property.
-
#enumerable ⇒ Boolean
(also: #enumerable?)
readonly
True if JavaScript code can enumerate this property.
-
#name ⇒ String
readonly
The property’s name.
-
#owner ⇒ WebkitRemote::JsObject
readonly
The object that this property belongs to.
-
#value ⇒ WebkitRemote::Client::JsObject, ...
readonly
A Ruby wrapper for the property’s value; primitives get wrapped by standard Ruby classes, and objects get wrapped by JsObject instances.
-
#writable ⇒ Boolean
(also: #writable?)
readonly
True if JavaScript code can change this property’s value.
Instance Method Summary collapse
-
#initialize(raw_property, owner) ⇒ JsProperty
constructor
A new instance of JsProperty.
-
#inspect ⇒ Object
Debugging output.
Constructor Details
#initialize(raw_property, owner) ⇒ JsProperty
Returns a new instance of JsProperty.
477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 |
# 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 |
Instance Attribute Details
#configurable ⇒ Boolean (readonly) Also known as: configurable?
Returns true if JavaScript code can remove this property.
457 458 459 |
# File 'lib/webkit_remote/client/runtime.rb', line 457 def configurable @configurable end |
#enumerable ⇒ Boolean (readonly) Also known as: enumerable?
Returns true if JavaScript code can enumerate this property.
461 462 463 |
# File 'lib/webkit_remote/client/runtime.rb', line 461 def enumerable @enumerable end |
#name ⇒ String (readonly)
Returns the property’s name.
448 449 450 |
# File 'lib/webkit_remote/client/runtime.rb', line 448 def name @name end |
#owner ⇒ WebkitRemote::JsObject (readonly)
Returns the object that this property belongs to.
470 471 472 |
# File 'lib/webkit_remote/client/runtime.rb', line 470 def owner @owner end |
#value ⇒ WebkitRemote::Client::JsObject, ... (readonly)
Returns a Ruby wrapper for the property’s value; primitives get wrapped by standard Ruby classes, and objects get wrapped by JsObject instances.
454 455 456 |
# File 'lib/webkit_remote/client/runtime.rb', line 454 def value @value end |
#writable ⇒ Boolean (readonly) Also known as: writable?
Returns true if JavaScript code can change this property’s value.
465 466 467 |
# File 'lib/webkit_remote/client/runtime.rb', line 465 def writable @writable end |
Instance Method Details
#inspect ⇒ Object
Debugging output.
496 497 498 499 500 501 502 |
# 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 |