Bump version to 1.9900 for new version numbering scheme
[gitmo/Moose.git] / lib / Moose / Meta / Method / Accessor / Native / String / match.pm
CommitLineData
e7724627 1package Moose::Meta::Method::Accessor::Native::String::match;
2
3use strict;
4use warnings;
5
88e88a7b 6use Moose::Util ();
7use Params::Util ();
8
bb8ef151 9our $VERSION = '1.9900';
e7724627 10$VERSION = eval $VERSION;
11our $AUTHORITY = 'cpan:STEVAN';
12
8b9641b8 13use Moose::Role;
14
15with 'Moose::Meta::Method::Accessor::Native::Reader' => {
16 -excludes => [
17 qw(
18 _minimum_arguments
19 _maximum_arguments
20 _inline_check_arguments
21 )
22 ]
23};
e7724627 24
25sub _minimum_arguments { 1 }
8b9641b8 26
e7724627 27sub _maximum_arguments { 1 }
28
29sub _inline_check_arguments {
30 my $self = shift;
31
53a4677c 32 return (
33 'if (!Moose::Util::_STRINGLIKE0($_[0]) && !Params::Util::_REGEX($_[0])) {',
34 $self->_inline_throw_error(
35 '"The argument passed to match must be a string or regexp '
36 . 'reference"',
37 ) . ';',
38 '}',
39 );
e7724627 40}
41
42sub _return_value {
53a4677c 43 my $self = shift;
44 my ($slot_access) = @_;
e7724627 45
53a4677c 46 return $slot_access . ' =~ $_[0]';
e7724627 47}
48
8b9641b8 49no Moose::Role;
50
e7724627 511;