Elive::Util::Type - Type introspection class
$type = Elive::Util::inspect_type('Elive::Entity::Participants'); if ($type->is_array) { # ... }
Creates an object of type Elive::Util::Type.
Return true, if the type is an ancestor of Elive::DAO
Return true if the elemental_type is a reference; including objects.
Return an elemental class if objects are substantiated as arrays.
my $type = Elive::Util::Type->new('Elive::Entity::Participants'); print $type->is_array; # prints Elive::Entity::Participant
If the class is an array, the is_struct() and is_ref() methods inquire on the properties of the element class.
is_struct()
is_ref()
Returns the type of the class. For arrays, returns the array element class.
Return the full type union. For arrays, returns the union of all possible array element classes.
my @types = Elive::Util::Type->new(' Elive::Entity::Group::Members')->union; # # group members may contain sub-groups, user objects, or packed strings is(\@types, [qw(Elive::Entity::Group Str)]);
To install Elive, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Elive
CPAN shell
perl -MCPAN -e shell install Elive
For more information on module installation, please visit the detailed CPAN module installation guide.