Beginning of dzilization
[gitmo/Moose.git] / lib / Moose / Meta / Object / Trait.pm
1
2 package Moose::Meta::Object::Trait;
3
4 use Scalar::Util qw(blessed);
5
6 our $AUTHORITY = 'cpan:STEVAN';
7
8 sub _get_compatible_metaclass {
9     my $orig = shift;
10     my $self = shift;
11     return $self->$orig(@_)
12         || $self->_get_compatible_metaclass_by_role_reconciliation(@_);
13 }
14
15 sub _get_compatible_metaclass_by_role_reconciliation {
16     my $self = shift;
17     my ($other_name) = @_;
18     my $meta_name = blessed($self) ? $self->_real_ref_name : $self;
19
20     return unless Moose::Util::_classes_differ_by_roles_only(
21         $meta_name, $other_name
22     );
23
24     return Moose::Util::_reconcile_roles_for_metaclass(
25         $meta_name, $other_name
26     );
27 }
28
29 1;
30
31 # ABSTRACT: Some overrides for L<Class::MOP::Object> functionality
32
33 __END__
34
35 =pod
36
37 =head1 DESCRIPTION
38
39 This module is entirely private, you shouldn't ever need to interact with
40 it directly.
41
42 =head1 BUGS
43
44 See L<Moose/BUGS> for details on reporting bugs.
45
46 =cut