Use dzil Authority plugin - remove $AUTHORITY from code
[gitmo/Moose.git] / lib / Moose / Meta / Method / Accessor / Native / Hash / exists.pm
1 package Moose::Meta::Method::Accessor::Native::Hash::exists;
2
3 use strict;
4 use warnings;
5
6 use Scalar::Util qw( looks_like_number );
7
8 use Moose::Role;
9
10 with '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';
20
21 sub _minimum_arguments { 1 }
22
23 sub _maximum_arguments { 1 }
24
25 sub _inline_check_arguments {
26     my $self = shift;
27
28     return $self->_inline_check_var_is_valid_key('$_[0]');
29 }
30
31 sub _return_value {
32     my $self = shift;
33     my ($slot_access) = shift;
34
35     return 'exists ' . $slot_access . '->{ $_[0] }';
36 }
37
38 no Moose::Role;
39
40 1;