| 1 | package Pod::Elemental::Command 0.103006; | ||||||||||
| 2 | # ABSTRACT: a =command paragraph | ||||||||||
| 3 | |||||||||||
| 4 | 15 | ▶ | use Moose::Role 0.90; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | 15 | with 'Pod::Elemental::Paragraph' => { -excludes => [ 'as_pod_string' ] }; | |||||||||
| 6 | |||||||||||
| 7 | #pod =head1 OVERVIEW | ||||||||||
| 8 | #pod | ||||||||||
| 9 | #pod This is a role to be included by paragraph classes that represent Pod commands. | ||||||||||
| 10 | #pod It defines C<as_pod_string> and C<as_debug_string> methods. Most code looking | ||||||||||
| 11 | #pod for commands will check for the inclusion of this role, so be sure to use it | ||||||||||
| 12 | #pod even if you override the provided methods. Classes implementing this role must | ||||||||||
| 13 | #pod also provide a C<command> method. Generally this method will implemented by | ||||||||||
| 14 | #pod an attribute, but this is not necessary. | ||||||||||
| 15 | #pod | ||||||||||
| 16 | #pod =cut | ||||||||||
| 17 | |||||||||||
| 18 | 15 | requires 'command'; | |||||||||
| 19 | |||||||||||
| 20 | 32 | ▶ | sub as_pod_string { | ||||||||
|
Subroutine
as_pod_string: called CC=2 SCAR=6.9
Pod
undocumented
| |||||||||||
| 21 | 32 | my ($self) = @_; | |||||||||
| 22 | |||||||||||
| 23 | 32 | my $content = $self->content; | |||||||||
| 24 | |||||||||||
| 25 | 32 | ▶ | sprintf "=%s%s", $self->command, ($content =~ /\S/ ? " $content" : $content); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 26 | } | ||||||||||
| 27 | |||||||||||
| 28 | 0 | ▶ | sub as_debug_string { | ||||||||
|
Subroutine
as_debug_string: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 29 | 0 | my ($self) = @_; | |||||||||
| 30 | 0 | my $str = $self->_summarize_string($self->content); | |||||||||
| 31 | 0 | return sprintf '=%s %s', $self->command, $str; | |||||||||
| 32 | } | ||||||||||
| 33 | |||||||||||
| 34 | 15 | 1; | |||||||||
| 35 | |||||||||||
| 36 | __END__ | ||||||||||