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 | ||
8b9641b8 | 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 | }; | |
910684ee | 19 | |
a7821be5 | 20 | sub _minimum_arguments { 1 } |
21 | ||
22 | sub _maximum_arguments { 1 } | |
910684ee | 23 | |
24 | sub _inline_check_arguments { | |
e3181911 | 25 | my $self = shift; |
26 | ||
53a4677c | 27 | return ( |
28 | 'if (!Moose::Util::_STRINGLIKE0($_[0])) {', | |
29 | $self->_inline_throw_error( | |
30 | '"The argument passed to join must be a string"', | |
31 | ) . ';', | |
32 | '}', | |
33 | ); | |
910684ee | 34 | } |
35 | ||
36 | sub _return_value { | |
53a4677c | 37 | my $self = shift; |
38 | my ($slot_access) = @_; | |
910684ee | 39 | |
53a4677c | 40 | return 'join $_[0], @{ (' . $slot_access . ') }'; |
910684ee | 41 | } |
42 | ||
8b9641b8 | 43 | no Moose::Role; |
44 | ||
910684ee | 45 | 1; |