]> git.vpit.fr Git - perl/modules/with.git/blob - t/lib/with/TestClass.pm
Importing with-0.01
[perl/modules/with.git] / t / lib / with / TestClass.pm
1 package with::TestClass;
2
3 use strict;
4 use warnings;
5
6 sub new {
7  my $class = shift;
8  my %args = @_;
9  $class = ref $class || $class || return;
10  bless { id => $args{id}, is => $args{is} }, $class;
11 }
12
13 sub foo {
14  my $self = shift;
15  $self->{is}->($_[0], __PACKAGE__, __PACKAGE__ . '::foo was called');
16  $self->{is}->($_[1], $self->{id}, 'id in foo is correct');
17 }
18
19 sub bar {
20  my $self = shift;
21  $self->{is}->($_[0], __PACKAGE__, __PACKAGE__ . '::bar was called');
22  $self->{is}->($_[1], $self->{id}, 'id in bar is correct');
23 }
24
25 1;