Class-Anonymous
view release on metacpan or search on metacpan
lib/Class/Anonymous.pm view on Meta::CPAN
Takes a block (or code reference) which will be called to build and instance of that class.
The callback is called with the new empty instance and any arguments passed to C<new>.
Note that subclasses might need more initialization arguments, so you might want to plan for that.
=head2 extend
my $subclass = extend $class, sub { my ($self) = @_; ... };
Define a new subclass of an existing anonymous class.
Takes an existing class and a code reference which will be called after the parent class builder callback(s).
Note that all callbacks receive the same arguments, so you might want to plan for that.
=head2 via
my $subclass = extend $class, via { my ($self) = @_; ... };
Sugar for defining a code reference as a block, simply to make L</extend> look better.
=head1 OTHER FUNCTIONS
=head2 instance
( run in 0.339 second using v1.01-cache-2.11-cpan-9b1e4054eb1 )