I define a method inside a parametrized role that needs to create a new class at run time
using Moose::Meta::Class->create
and apply that exact parametrized role to it. I am also making a new method for that role using
$new_class->meta->add_method( some_name => sub {
my ($self) = @_;
...
})
inside the sub {...} I want to access a method of the consumer class and use it for something, I have tried using $self->get_method
, it didn't work, how do I do this?
Please notice that the $self
inside the sub above is MooseX::Role::Parameterized::Meta::Role::Parameterizable
I also have another question, if I do this:
my $object = Moose::Meta::Class->create(
"some_type",
);
Why isn't $object
of type some_type and it's some ugly MooseX::Role::Parameterized::Meta::Role::Parameterizable
and how do I get to the object of type some_type?