9 use MooseX::Params::Validate;
11 qw{""} => 'to_string',
17 default => '1.10.100',
21 my ( $self, %args ) = validated_hash(
30 # 1.10.100 => 0001.0010.0100
35 map { sprintf( "%04d", $_ ) } split( /\./, $self->id )
43 isa_ok( my $foo = Foo->new(), 'Foo', 'new' );
45 is( $foo->id, '1.10.100', 'id' );
47 is( $foo->to_string, '1.10.100', 'to_string' );
50 $foo->to_string( padded => 1 ), '0001.0010.0100',
51 'to_string( padded => 1 )'