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