change role-to-role application to allow method shadowing
[gitmo/Moose.git] / lib / Moose / Meta / Method / Accessor / Native / Hash / defined.pm
CommitLineData
44babf1f 1package Moose::Meta::Method::Accessor::Native::Hash::defined;
2
3use strict;
4use warnings;
5
6use Scalar::Util qw( looks_like_number );
7
8b9641b8 8use Moose::Role;
9
10with 'Moose::Meta::Method::Accessor::Native::Reader' => {
11 -excludes => [
12 qw(
13 _minimum_arguments
14 _maximum_arguments
15 _inline_check_arguments
16 )
17 ],
18 },
19 'Moose::Meta::Method::Accessor::Native::Hash';
44babf1f 20
21sub _minimum_arguments { 1 }
22
23sub _maximum_arguments { 1 }
24
25sub _inline_check_arguments {
26 my $self = shift;
27
28 return $self->_inline_check_var_is_valid_key('$_[0]');
29}
30
31sub _return_value {
53a4677c 32 my $self = shift;
33 my ($slot_access) = @_;
44babf1f 34
53a4677c 35 return 'defined ' . $slot_access . '->{ $_[0] }';
44babf1f 36}
37
8b9641b8 38no Moose::Role;
44babf1f 39
401;