| 1 | package XML::Grammar::Screenplay::API::ImageListDoc; | ||
| 2 | 5 | $XML::Grammar::Screenplay::API::ImageListDoc::VERSION = '0.32.0'; | |
| 3 | 5 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | 5 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | |||
| 6 | 5 | ▶ | use MooX 'late'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 7 | |||
| 8 | 5 | extends('XML::Grammar::Screenplay::FromProto'); | |
| 9 | |||
| 10 | 5 | has ['_dom'] => ( is => 'rw' ); | |
| 11 | 5 | has ['_xml'] => ( is => 'rw' ); | |
| 12 | |||
| 13 | sub list_images | ||
| 14 | 3 | ▶ | { |
|
Subroutine
list_images: called CC=2 SCAR=6.9
Pod
documented
| |||
| 15 | 3 | my ($self) = @_; | |
| 16 | 3 | my %found; | |
| 17 | |||
| 18 | 3 | my $xpc = XML::LibXML::XPathContext->new(); | |
| 19 | 3 | $xpc->registerNs( 's', | |
| 20 | q{http://web-cpan.berlios.de/modules/XML-Grammar-Screenplay/screenplay-xml-0.2/} | ||
| 21 | ); | ||
| 22 | 3 | foreach | |
| 23 | my $img ( $xpc->find( q{//s:image}, $self->_dom() )->get_nodelist() ) | ||
| 24 | { | ||
| 25 | 9 | ++$found{ $img->getAttribute('url') }; | |
| 26 | } | ||
| 27 | |||
| 28 | return [ | ||
| 29 | map { | ||
| 30 | 3 | XML::Grammar::Screenplay::API::ImageListDoc::_Record->new( | |
| 31 | { | ||
| 32 | _uri => $_, | ||
| 33 | } | ||
| 34 | ) | ||
| 35 | } | ||
| 36 | sort keys(%found) | ||
| 37 | ]; | ||
| 38 | } | ||
| 39 | |||
| 40 | 5 | 1; | |
| 41 | |||
| 42 | package XML::Grammar::Screenplay::API::ImageListDoc::_Record; | ||
| 43 | 5 | $XML::Grammar::Screenplay::API::ImageListDoc::_Record::VERSION = '0.32.0'; | |
| 44 | 5 | ▶ | use MooX 'late'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 45 | |||
| 46 | 5 | has '_uri' => ( is => 'ro' ); | |
| 47 | |||
| 48 | sub uri | ||
| 49 | 9 | ▶ | { |
|
Subroutine
uri: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 50 | 9 | my ( $self, ) = @_; | |
| 51 | |||
| 52 | 9 | return $self->_uri(); | |
| 53 | } | ||
| 54 | |||
| 55 | 5 | 1; | |
| 56 | |||
| 57 | # __END__ | ||
| 58 | # # Below is stub documentation for your module. You'd better edit it! | ||
| 59 | |||
| 60 | __END__ | ||