~ubuntu-branches/ubuntu/wily/libdata-perl-perl/wily

« back to all changes in this revision

Viewing changes to .pc/pod-syntax.patch/lib/Data/Perl/Role/Code.pm

  • Committer: Package Import Robot
  • Author(s): gregor herrmann
  • Date: 2014-06-26 19:50:36 UTC
  • mfrom: (1.1.1)
  • Revision ID: package-import@ubuntu.com-20140626195036-ha01k824iwswsi5d
Tags: 0.002008-1
* Team upload.
* New upstream release.
* Don't install README.mkdn, just a text version of the POD.
* Update years of upstream copyright.
* Set debhelper compatibility level to 8.
* Update short description.
* Add patch to fix POD syntax errors.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
package Data::Perl::Role::Code;
 
2
$Data::Perl::Role::Code::VERSION = '0.002008';
 
3
# ABSTRACT: Wrapping class for Perl coderefs.
 
4
 
 
5
use strictures 1;
 
6
 
 
7
use Role::Tiny;
 
8
 
 
9
sub new { my $cl = shift; bless $_[0], $cl }
 
10
 
 
11
sub execute { $_[0]->(@_[1..$#_]) }
 
12
 
 
13
#sub execute_method { $_[0]->($_[0], @_[1..$#_]) }
 
14
sub execute_method { die 'This remains unimplemented for now.' }
 
15
 
 
16
1;
 
17
 
 
18
=pod
 
19
 
 
20
=encoding UTF-8
 
21
 
 
22
=head1 NAME
 
23
 
 
24
Data::Perl::Role::Code - Wrapping class for Perl coderefs.
 
25
 
 
26
=head1 VERSION
 
27
 
 
28
version 0.002008
 
29
 
 
30
=head1 SYNOPSIS
 
31
 
 
32
  use Data::Perl qw/code/;
 
33
 
 
34
  my $code = code(sub { 'Foo'} );
 
35
 
 
36
  $code->execute(); # returns 'Foo';
 
37
 
 
38
=head1 DESCRIPTION
 
39
 
 
40
This class provides a wrapper and methods for interacting with Perl coderefs.
 
41
 
 
42
=head1 PROVIDED METHODS
 
43
 
 
44
=over 4
 
45
 
 
46
=item B<new($coderef)>
 
47
 
 
48
Constructs a new Data::Perl::Code object, initialized to $coderef as passed in,
 
49
and returns it.
 
50
 
 
51
=item * B<execute(@args)>
 
52
 
 
53
Calls the coderef with the given args.
 
54
 
 
55
=item * B<execute_method(@args)>
 
56
 
 
57
Calls the coderef with the the instance as invocant and given args. B<This is
 
58
currently disabled and triggers a die due to implementation details yet to be
 
59
resolved.>
 
60
 
 
61
=back
 
62
 
 
63
=head1 SEE ALSO
 
64
 
 
65
=over 4
 
66
 
 
67
=item * L<Data::Perl>
 
68
 
 
69
=item * L<MooX::HandlesVia>
 
70
 
 
71
=back
 
72
 
 
73
=head1 AUTHOR
 
74
 
 
75
Matthew Phillips <mattp@cpan.org>
 
76
 
 
77
=head1 COPYRIGHT AND LICENSE
 
78
 
 
79
This software is copyright (c) 2014 by Matthew Phillips <mattp@cpan.org>.
 
80
 
 
81
This is free software; you can redistribute it and/or modify it under
 
82
the same terms as the Perl 5 programming language system itself.
 
83
 
 
84
=cut
 
85
 
 
86
__END__
 
87
==pod
 
88