Commit | Line | Data |
44babf1f |
1 | package Moose::Meta::Method::Accessor::Native::Hash::defined; |
2 | |
3 | use strict; |
4 | use warnings; |
5 | |
6 | use Scalar::Util qw( looks_like_number ); |
7 | |
8b9641b8 |
8 | use Moose::Role; |
9 | |
00bbc132 |
10 | with 'Moose::Meta::Method::Accessor::Native::Reader', |
11 | 'Moose::Meta::Method::Accessor::Native::Hash'; |
44babf1f |
12 | |
13 | sub _minimum_arguments { 1 } |
14 | |
15 | sub _maximum_arguments { 1 } |
16 | |
17 | sub _inline_check_arguments { |
18 | my $self = shift; |
19 | |
20 | return $self->_inline_check_var_is_valid_key('$_[0]'); |
21 | } |
22 | |
23 | sub _return_value { |
53a4677c |
24 | my $self = shift; |
25 | my ($slot_access) = @_; |
44babf1f |
26 | |
53a4677c |
27 | return 'defined ' . $slot_access . '->{ $_[0] }'; |
44babf1f |
28 | } |
29 | |
8b9641b8 |
30 | no Moose::Role; |
44babf1f |
31 | |
32 | 1; |