diff options
author | Lorry Tar Creator <lorry-tar-importer@lorry> | 2015-01-31 02:13:12 +0000 |
---|---|---|
committer | Lorry Tar Creator <lorry-tar-importer@lorry> | 2015-01-31 02:13:12 +0000 |
commit | 7446bb2b9d24fa6b702fbb62d73084a32ade6f75 (patch) | |
tree | 50037edde1d3cde3aaa25e759cd39975841ca663 /t/lib/Charlie.pm | |
download | Class-Tiny-tarball-Class-Tiny-1.001.tar.gz |
Class-Tiny-1.001HEADClass-Tiny-1.001master
Diffstat (limited to 't/lib/Charlie.pm')
-rw-r--r-- | t/lib/Charlie.pm | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/t/lib/Charlie.pm b/t/lib/Charlie.pm new file mode 100644 index 0000000..7d312bd --- /dev/null +++ b/t/lib/Charlie.pm @@ -0,0 +1,28 @@ +use 5.006; +use strict; +use warnings; + +package Charlie; + +use subs qw/bar baz/; + +use Class::Tiny qw/foo bar/, { baz => 23 }; + +sub bar { + my $self = shift; + if (@_) { + $self->{bar} = [@_]; + } + return $self->{bar}; +} + +sub baz { + my $self = shift; + if (@_) { + $self->{baz} = shift; + } + return $self->{baz} ||= + Class::Tiny->get_all_attribute_defaults_for( ref $self )->{baz}; +} + +1; |