12 use Moose::Util::TypeConstraints;
18 => as 'DBIx::Class::ResultSet';
21 => as 'ArrayRef[Int]';
23 MooseX::Getopt::OptionTypeMap->add_option_type_to_map(
30 return [ grep { m/^\d+$/ } split /\D/,$_ ]; # <- split string into arrayref
35 isa => 'ResultList | ResultSet', # <- union constraint
45 # Without MooseX::Getopt
47 my $example = example->new({
48 results => '1234,5678,9012',
51 isa_ok($example, 'example');
52 is_deeply($example->results, [qw(1234 5678 9012)], 'result as expected');
57 local @ARGV = ('--results','1234,5678,9012','--other','test');
58 my $example = example->new_with_options;
59 isa_ok($example, 'example');
61 is($example->other,'test');
62 is_deeply($example->results, [qw(1234 5678 9012)], 'result as expected');