~ubuntu-branches/ubuntu/vivid/libclass-accessor-grouped-perl/vivid

« back to all changes in this revision

Viewing changes to t/lib/AccessorGroups.pm

  • Committer: Package Import Robot
  • Author(s): Xavier Guimard
  • Date: 2013-03-19 06:29:32 UTC
  • mto: This revision was merged to the branch mainline in revision 16.
  • Revision ID: package-import@ubuntu.com-20130319062932-xngayhbrbvykfcvh
Tags: upstream-0.10009
ImportĀ upstreamĀ versionĀ 0.10009

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
__PACKAGE__->mk_group_accessors('multiple', qw/multiple1 multiple2/);
19
19
__PACKAGE__->mk_group_accessors('listref', [qw/lr1name lr1;field/], [qw/lr2name lr2'field/]);
20
20
__PACKAGE__->mk_group_accessors('simple', 'runtime_around');
 
21
__PACKAGE__->mk_group_accessors('simple', [ fieldname_torture => join ('', map { chr($_) } (0..255) ) ]);
21
22
 
22
23
sub get_simple {
23
24
  my $v = shift->SUPER::get_simple (@_);
57
58
}
58
59
 
59
60
sub new {
60
 
    return bless {}, shift;
 
61
  return bless {}, shift;
61
62
};
62
63
 
63
64
foreach (qw/multiple listref/) {
64
 
    no strict 'refs';
65
 
    *{"get_$_"} = __PACKAGE__->can('get_simple');
66
 
    *{"set_$_"} = __PACKAGE__->can('set_simple');
 
65
  no strict 'refs';
 
66
  *{"get_$_"} = __PACKAGE__->can('get_simple');
 
67
  *{"set_$_"} = __PACKAGE__->can('set_simple');
67
68
};
68
69
 
69
70
1;