When you invoke (use
) the Object::Realize::Later
package, it will
add a set of methods to your package (see section Added to YOUR class).
Option | Default |
---|---|
becomes | <required> |
believe_caller | <false> |
realize | <required> |
source_module | <becomes> |
warn_realization | <false> |
warn_realize_again | <false> |
When a method is called which is not available for the lazy object, the AUTOLOAD is called.
Is the specified METHOD available for the lazy or the realized version of this object? It will return the reference to the code.
MyLazyObject->can('lazyWork') # true MyLazyObject->can('realWork') # true my $lazy = MyLazyObject->new; $lazy->can('lazyWork'); # true $lazy->can('realWork'); # true
You can force the load by calling this method on your object. It returns the realized object.
Is this object a (sub-)class of the specified CLASS or can it become a (sub-)class of CLASS.
MyLazyObject->isa('MyRealObject') # true MyLazyObject->isa('SuperClassOfLazy'); # true MyLazyObject->isa('SuperClassOfReal'); # true my $lazy = MyLazyObject->new; $lazy->isa('MyRealObject'); # true $lazy->isa('SuperClassOfLazy'); # true $lazy->isa('SuperClassOfReal'); # true
Returns which class will be the realized to follow-up this class.
The next methods are not exported to the class where the `use' took place. These methods implement the actual realization.
The OPTIONS used for import
are the values after the class name
with use
. So this routine implements the actual option parsing.
It generates code dynamically, which is then evaluated in the
callers name-space.
Returns the REALIZED version of OBJECT, optionally after setting it
first. When the method returns undef
, the realization has not
yet taken place or the realized object has already been removed again.
This method is called when a $object->forceRealize()
takes
place. It checks whether the realization has been done already
(is which case the realized object is returned)