Skip to content

Commit

Permalink
use a more generic Mojo::Base example
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Mar 22, 2015
1 parent d6e8b30 commit 4d0f723
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/Mojo/Base.pm
Expand Up @@ -104,7 +104,7 @@ Mojo::Base - Minimal base class for Mojo projects
use Mojo::Base -base;
has name => 'Nyan';
has [qw(birds mice)] => 2;
has [qw(age weight)] => 4;
package Tiger;
use Mojo::Base 'Cat';
Expand All @@ -116,11 +116,11 @@ Mojo::Base - Minimal base class for Mojo projects
use Mojo::Base -strict;
my $mew = Cat->new(name => 'Longcat');
say $mew->mice;
say $mew->mice(3)->birds(4)->mice;
say $mew->age;
say $mew->age(3)->weight(5)->age;
my $rawr = Tiger->new(stripes => 23, mice => 0);
say $rawr->tap(sub { $_->friend->name('Tacgnol') })->mice;
my $rawr = Tiger->new(stripes => 38, weight => 250);
say $rawr->tap(sub { $_->friend->name('Tacgnol') })->weight;
=head1 DESCRIPTION
Expand Down

0 comments on commit 4d0f723

Please sign in to comment.