use Scalar::Util 'blessed', 'weaken';
use overload ();
-our $VERSION = '0.63';
+our $VERSION = '0.66';
our $AUTHORITY = 'cpan:STEVAN';
use Moose::Meta::Method::Accessor;
default coerce required
documentation lazy handles
builder type_constraint
+ definition_context
);
sub legal_options_for_inheritance { @legal_options_for_inheritance }
if ($self->should_coerce && $type_constraint->has_coercion) {
$val = $type_constraint->coerce($val);
}
- $self->check_type_constraint($val, instance => $instance);
+ $self->verify_against_type_constraint($val, instance => $instance);
}
$self->set_initial_value($instance, $val);
if ($type_constraint) {
$val = $type_constraint->coerce($val)
if $can_coerce;
- $self->check_type_constraint($val, object => $instance);
+ $self->verify_against_type_constraint($val, object => $instance);
}
$meta_instance->set_slot_value($instance, $slot_name, $val);
};
my $type_constraint = $self->type_constraint;
$value = $type_constraint->coerce($value)
if ($self->should_coerce);
- $self->check_type_constraint($value);
+ $self->verify_against_type_constraint($value);
}
$self->set_initial_value($instance, $value);
}
}
}
+sub delegation_metaclass { 'Moose::Meta::Method::Delegation' }
+
sub _make_delegation_method {
my ( $self, $handle_name, $method_to_call ) = @_;
$method_body = $method_to_call
if 'CODE' eq ref($method_to_call);
- return Moose::Meta::Method::Delegation->new(
+ return $self->delegation_metaclass->new(
name => $handle_name,
package_name => $self->associated_class->name,
attribute => $self,
);
}
-sub check_type_constraint {
+sub verify_against_type_constraint {
my $self = shift;
my $val = shift;
=item B<accessor_metaclass>
+=item B<delegation_metaclass>
+
=item B<get_value>
=item B<set_value>
more information on what you can do with this, see the documentation
for L<Moose::Meta::TypeConstraint>.
-=item B<check_type_constraint>
+=item B<verify_against_type_constraint>
-Confirms that the given value is valid under this attribute's type
+Verifies that the given value is valid under this attribute's type
constraint, otherwise throws an error.
=item B<has_handles>
=head1 COPYRIGHT AND LICENSE
-Copyright 2006-2008 by Infinity Interactive, Inc.
+Copyright 2006-2009 by Infinity Interactive, Inc.
L<http://www.iinteractive.com>