NAME
Venus::Role::Reflectable - Reflectable Role
ABSTRACT
Reflectable Role for Perl 5
SYNOPSIS
package Example;
use Venus::Class;
with 'Venus::Role::Reflectable';
sub test {
true
}
package main;
my $example = Example->new;
# $example->space;
DESCRIPTION
This package modifies the consuming package and provides methods for introspecting the object and its underlying package.
METHODS
This package provides the following methods:
class
class() (string)
The class method returns the class name for the given class or object.
Since 0.01
clone
clone() (object)
The clone method clones the invocant and returns the result.
Since 4.15
- clone example 1
-
# given: synopsis package main; my $clone = $example->clone; # bless(..., "Example")
meta
meta() (Venus::Meta)
The meta method returns a Venus::Meta object for the given object.
Since 1.23
- meta example 1
-
# given: synopsis; my $meta = $example->meta; # bless({name => "Example"}, "Venus::Meta")
reify
reify(string | coderef $code, any @args) (object)
The reify method dispatches the method call or executes the callback and returns the result as a value object.
Since 1.23
- reify example 2
-
# given: synopsis package main; my $reify = $example->reify('class'); # bless({value => "Example"}, "Venus::String")
- reify example 3
-
# given: synopsis package main; my $reify = $example->reify('test'); # bless({value => 1}, "Venus::Boolean")
space
space() (Venus::Space)
The space method returns a Venus::Space object for the given object.
Since 0.01
- space example 1
-
# given: synopsis; my $space = $example->space; # bless({ value => "Example" }, "Venus::Space")
what
what(string | coderef $code, any @args) (Venus::What)
The what method dispatches the method call or executes the callback and returns the result as a Venus::What object.
Since 0.01
- what example 1
-
# given: synopsis; my $what = $example->what; # bless({ value => bless({}, "Example") }, "Venus::What")
- what example 2
-
# given: synopsis; my $what = $example->what('class'); # bless({ value => "Example" }, "Venus::What")
AUTHORS
Awncorp, awncorp@cpan.org
LICENSE
Copyright (C) 2022, Awncorp, awncorp@cpan.org.
This program is free software, you can redistribute it and/or modify it under the terms of the Apache license version 2.0.