Commit | Line | Data |
---|---|---|
910684ee | 1 | package Moose::Meta::Method::Accessor::Native::Array::join; |
2 | ||
3 | use strict; | |
4 | use warnings; | |
5 | ||
88e88a7b | 6 | use Moose::Util (); |
7 | ||
245478d5 | 8 | our $VERSION = '1.19'; |
910684ee | 9 | $VERSION = eval $VERSION; |
10 | our $AUTHORITY = 'cpan:STEVAN'; | |
11 | ||
8b9641b8 | 12 | use Moose::Role; |
13 | ||
14 | with 'Moose::Meta::Method::Accessor::Native::Reader' => { | |
15 | -excludes => [ | |
16 | qw( | |
17 | _minimum_arguments | |
18 | _maximum_arguments | |
19 | _inline_check_arguments | |
20 | ) | |
21 | ] | |
22 | }; | |
910684ee | 23 | |
a7821be5 | 24 | sub _minimum_arguments { 1 } |
25 | ||
26 | sub _maximum_arguments { 1 } | |
910684ee | 27 | |
28 | sub _inline_check_arguments { | |
e3181911 | 29 | my $self = shift; |
30 | ||
53a4677c | 31 | return ( |
32 | 'if (!Moose::Util::_STRINGLIKE0($_[0])) {', | |
33 | $self->_inline_throw_error( | |
34 | '"The argument passed to join must be a string"', | |
35 | ) . ';', | |
36 | '}', | |
37 | ); | |
910684ee | 38 | } |
39 | ||
40 | sub _return_value { | |
53a4677c | 41 | my $self = shift; |
42 | my ($slot_access) = @_; | |
910684ee | 43 | |
53a4677c | 44 | return 'join $_[0], @{ (' . $slot_access . ') }'; |
910684ee | 45 | } |
46 | ||
8b9641b8 | 47 | no Moose::Role; |
48 | ||
910684ee | 49 | 1; |