}
sub build_import_methods{
- my($class, %args) = @_;
+ my($self, %args) = @_;
my $exporting_package = $args{exporting_package} ||= caller();
}
sub canonicalize_args{ # DEPRECATED
- my ($self, $name, %args) = @_;
+ #my($self, $name, %args) = @_;
+ my($self, undef, %args) = @_;
Carp::cluck("$self->canonicalize_args has been deprecated."
. "Use \$self->_process_options instead.");
}
sub create { # DEPRECATED
- my ($self, $class, $name, %args) = @_;
+ #my($self, $class, $name, %args) = @_;
+ my($self) = @_;
Carp::cluck("$self->create has been deprecated."
. "Use \$meta->add_attribute and \$attr->install_accessors instead.");
}
sub _coerce_and_verify {
- my($self, $value, $instance) = @_;
+ #my($self, $value, $instance) = @_;
+ my($self, $value) = @_;
my $type_constraint = $self->{type_constraint};
return $value if !defined $type_constraint;
sub associate_method{
- my ($attribute, $method_name) = @_;
+ #my($attribute, $method_name) = @_;
+ my($attribute) = @_;
$attribute->{associated_methods}++;
return;
}
}
sub _generate_accessor{
- my $class = shift;
- return $class->_generate_accessor_any(rw => @_);
+ #my($self, $attribute, $metaclass) = @_;
+ my $self = shift;
+ return $self->_generate_accessor_any(rw => @_);
}
sub _generate_reader {
- my $class = shift;
- return $class->_generate_accessor_any(ro => @_);
+ #my($self, $attribute, $metaclass) = @_;
+ my $self = shift;
+ return $self->_generate_accessor_any(ro => @_);
}
sub _generate_writer {
- my $class = shift;
- return $class->_generate_accessor_any(wo => @_);
+ #my($self, $attribute, $metaclass) = @_;
+ my $self = shift;
+ return $self->_generate_accessor_any(wo => @_);
}
sub _generate_predicate {
- my (undef, $attribute, $class) = @_;
+ #my($self, $attribute, $metaclass) = @_;
+ my(undef, $attribute) = @_;
my $slot = $attribute->name;
return sub{
}
sub _generate_clearer {
- my (undef, $attribute, $class) = @_;
+ #my($self, $attribute, $metaclass) = @_;
+ my(undef, $attribute) = @_;
my $slot = $attribute->name;
return sub{
}
sub _metaclass_cache { # DEPRECATED
- my($class, $name) = @_;
+ my($self, $name) = @_;
Carp::cluck('_metaclass_cache() has been deprecated. Use Mouse::Util::get_metaclass_by_name() instead');
return $METAS{$name};
}
}
sub throw_error{
- my($class, $message, %args) = @_;
+ my($self, $message, %args) = @_;
local $Carp::CarpLevel = $Carp::CarpLevel + 1 + ($args{depth} || 0);
local $Carp::MaxArgNums = 20; # default is 8, usually we use named args which gets messier though
}
sub _apply_attributes{
- my($role, $consumer, $args) = @_;
+ #my($role, $consumer, $args) = @_;
+ my($role, $consumer) = @_;
for my $attr_name ($role->get_attribute_list) {
next if $consumer->has_attribute($attr_name);
}
sub _apply_modifiers{
- my($role, $consumer, $args) = @_;
+ #my($role, $consumer, $args) = @_;
+ my($role, $consumer) = @_;
+
if(my $modifiers = $role->{override_method_modifiers}){
foreach my $method_name (keys %{$modifiers}){
}
sub _append_roles{
- my($role, $consumer, $args) = @_;
+ #my($role, $consumer, $args) = @_;
+ my($role, $consumer) = @_;
my $roles = $consumer->{roles};
sub combine {
- my($role_class, @role_specs) = @_;
+ my($self, @role_specs) = @_;
require 'Mouse/Meta/Role/Composite.pm'; # we don't want to create its namespace