NAME
MozRepl::RemoteObject::Methods - Perl methods for mozrepl objects
SYNOPSIS
my @links = $obj->MozRepl::RemoteObject::Methods::xpath('//a');
This module holds the routines that previously lived as injected object methods on all Javascript objects.
METHODS
$obj->MozRepl::RemoteObject::Methods::invoke(METHOD, ARGS)
The invoke()
object method is an alternate way to invoke Javascript methods. It is normally equivalent to $obj->$method(@ARGS)
. This function must be used if the METHOD name contains characters not valid in a Perl variable name (like foreign language characters). To invoke a Javascript objects native __invoke
method (if such a thing exists), please use:
$object->MozRepl::RemoteObject::Methods::invoke('__invoke', @args);
This method can be used to call the Javascript functions with the same name as other convenience methods implemented in Perl:
__attr
__setAttr
__xpath
__click
...
$obj->MozRepl::RemoteObject::Methods::transform_arguments(@args)
This method transforms the passed in arguments to their JSON string representations.
Things that match /^(?:[1-9][0-9]*|0+)$/
get passed through.
MozRepl::RemoteObject::Instance instances are transformed into strings that resolve to their Javascript global variables. Use the ->expr
method to get an object representing these.
It's also impossible to pass a negative or fractional number as a number through to Javascript, or to pass digits as a Javascript string.
$obj->MozRepl::RemoteObject::Methods::id
Readonly accessor for the internal object id that connects the Javascript object to the Perl object.
$obj->MozRepl::RemoteObject::Methods::on_destroy
Accessor for the callback that gets invoked from DESTROY
.
$obj->MozRepl::RemoteObject::Methods::bridge
Readonly accessor for the bridge that connects the Javascript object to the Perl object.
MozRepl::RemoteObject::Methods::as_hash($obj)
MozRepl::RemoteObject::Methods::as_array($obj)
MozRepl::RemoteObject::Methods::as_code($obj)
Returns a reference to a hash/array/coderef. This is used by overload. Don't use these directly.
SEE ALSO
MozRepl::RemoteObject for the objects to use this with
REPOSITORY
The public repository of this module is http://github.com/Corion/mozrepl-remoteobject.
AUTHOR
Max Maischein corion@cpan.org
COPYRIGHT (c)
Copyright 2011 by Max Maischein corion@cpan.org
.
LICENSE
This module is released under the same terms as Perl itself.