NAME

Art::World::Util - Generating all kind of data for the Art::World

SYNOPSIS

use Art::World::Util;

say Art::World::Util->new_person->fake_name;
#==> Firtname Lastname

say Art::World::Util->new_math->pick( 10, 1000 ));
#==> 666

DESCRIPTION

Art::World::Util provide useful generation tools for automated Agents creation, data manipulation and other utilities that are not strictly related to the Art::World entities.

Methods

Art::World::Math

Artists usually don't like maths too much.

pick()

Pick an integer between a range that can be passed as a parameter. Mostly a way to not have to memorize $min + int ( rand ( $max - $min )).

Art::World::Meta

Looks like the Art::World::Meta toolkit. See https://metacpan.org/pod/Class::MOP::Class for extreme cases.

my $meta = $self->meta;

Also there is the Zydeco's $class object.

This is a couple of utilities that makes a sort of meta-programming very simple. It is more like a reminder for my bad memory than something very interesting. Largely inspired by this Perl Monks thread.

Art::World::Meta->get_all_attributes( $artist );
# ==>  ( 'id', 'name', 'reputation', 'artworks', 'collectors', 'collected', 'status' )

Mostly useless since Zydeco rely on Moo(se) so the Moose Meta Object Protocol is available.

get_class( Object $klass )

Returns the class of the object.

get_set_attributes_only( Object $clazz )

Returns only attributes that are set for a particular object.

get_all_attributes( Object $claxx )

Returns even non-set attributes for a particular object.

Art::World::Person

fake_name()

Generate a complete person name using Faker.

Art::World::String

titlify()

Art::World::Time

Handy way for generating a Time::Moment object that can be used for Events for example.

my $t = Art::World::Util->new_time( source => '2020-02-16T08:18:43' );

AUTHOR

Sébastien Feugère <sebastien@feugere.net>

COPYRIGHT AND LICENSE

Copyright 2006-2021 Sebastien Feugère

This library is free software; you can redistribute it and/or modify it under the Artistic License 2.0.