Venus::Role::Reflectable - Reflectable Role
Reflectable Role for Perl 5
package Example; use Venus::Class; with 'Venus::Role::Reflectable'; sub test { true } package main; my $example = Example->new; # $example->space;
This package modifies the consuming package and provides methods for introspecting the object and its underlying package.
This package provides the following methods:
class() (Str)
The class method returns the class name for the given class or object.
Since 0.01
0.01
# given: synopsis; my $class = $example->class; # "Example"
meta() (Meta)
The meta method returns a Venus::Meta object for the given object.
Since 1.23
1.23
# given: synopsis; my $meta = $example->meta; # bless({name => "Example"}, "Venus::Meta")
reify(Str | CodeRef $code, Any @args) (Object)
The reify method dispatches the method call or executes the callback and returns the result as a value object.
# given: synopsis package main; my $reify = $example->reify; # bless({}, "Example")
# given: synopsis package main; my $reify = $example->reify('class'); # bless({value => "Example"}, "Venus::String")
# given: synopsis package main; my $reify = $example->reify('test'); # bless({value => 1}, "Venus::Boolean")
space() (Space)
The space method returns a Venus::Space object for the given object.
# given: synopsis; my $space = $example->space; # bless({ value => "Example" }, "Venus::Space")
type(Str | CodeRef $code, Any @args) (Type)
The type method dispatches the method call or executes the callback and returns the result as a Venus::Type object.
# given: synopsis; my $type = $example->type; # bless({ value => bless({}, "Example") }, "Venus::Type")
# given: synopsis; my $type = $example->type('class'); # bless({ value => "Example" }, "Venus::Type")
To install Venus, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Venus
CPAN shell
perl -MCPAN -e shell install Venus
For more information on module installation, please visit the detailed CPAN module installation guide.