« blib/lib/XML/Grammar/Fiction/FromProto/Parser/QnD.pm
↑ Summary
blib/lib/XML/Grammar/Screenplay/FromProto.pm »
| 1 | package XML::Grammar::FictionBase::Event; | ||||||||||||||||||||
| 2 | 17 | $XML::Grammar::FictionBase::Event::VERSION = '0.22.0'; | |||||||||||||||||||
| 3 | |||||||||||||||||||||
| 4 | 17 | ▶ | use strict; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 5 | 17 | ▶ | use warnings; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 6 | |||||||||||||||||||||
| 7 | 17 | ▶ | use MooX 'late'; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 8 | |||||||||||||||||||||
| 9 | 17 | ▶ | use XML::Grammar::Fiction::FromProto::Node (); | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 10 | |||||||||||||||||||||
| 11 | 17 | has 'type' => ( isa => "Str", is => "ro" ); | |||||||||||||||||||
| 12 | 17 | has 'tag' => ( isa => "Maybe[Str]", is => "ro", predicate => '_has_tag', ); | |||||||||||||||||||
| 13 | 17 | has 'elem' => | |||||||||||||||||||
| 14 | ( isa => "Maybe[XML::Grammar::Fiction::FromProto::Node]", is => "ro" ); | ||||||||||||||||||||
| 15 | 17 | has 'tag_elem' => | |||||||||||||||||||
| 16 | ( isa => "Maybe[XML::Grammar::Fiction::FromProto::Node]", is => "ro" ); | ||||||||||||||||||||
| 17 | |||||||||||||||||||||
| 18 | sub is_tag_of_name | ||||||||||||||||||||
| 19 | { | ||||||||||||||||||||
| 20 | 0 | ▶ | my ( $self, $name ) = @_; | ||||||||||||||||||
|
Subroutine
is_tag_of_name: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||||||||||||
| 21 | |||||||||||||||||||||
| 22 | 0 | ▶ | return ( $self->_has_tag() && ( $self->tag() eq $name ) ); | ||||||||||||||||||
|
Condition0%0/3
$self->_has_tag && $self->tag eq $name
MC/DC0%0/2
$self->_has_tag && $self->tag eq $name
$self->_has_tag
$self->tag eq $name
Truth table0%0/3
A && B
A= $self->_has_tagB= $self->tag eq $name
| |||||||||||||||||||||
| 23 | } | ||||||||||||||||||||
| 24 | |||||||||||||||||||||
| 25 | sub is_open | ||||||||||||||||||||
| 26 | { | ||||||||||||||||||||
| 27 | 556 | ▶ | my $self = shift; | ||||||||||||||||||
|
Subroutine
is_open: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||
| 28 | |||||||||||||||||||||
| 29 | 556 | return ( $self->type() eq "open" ); | |||||||||||||||||||
| 30 | } | ||||||||||||||||||||
| 31 | |||||||||||||||||||||
| 32 | sub is_open_or_close | ||||||||||||||||||||
| 33 | { | ||||||||||||||||||||
| 34 | 1219 | ▶ | my $self = shift; | ||||||||||||||||||
|
Subroutine
is_open_or_close: called CC=2 SCAR=6.9
Pod
documented
| |||||||||||||||||||||
| 35 | |||||||||||||||||||||
| 36 | 1219 | ▶ | return ( ( $self->type() eq "open" ) || ( $self->type() eq "close" ) ); | ||||||||||||||||||
|
Condition100%3/3
$self->type eq 'open' || $self->type eq 'close'
MC/DC100%2/2
$self->type eq 'open' || $self->type eq 'close'
$self->type eq 'open'
$self->type eq 'close'
Truth table100%3/3
A || B
A= $self->type eq 'open'B= $self->type eq 'close'
| |||||||||||||||||||||
| 37 | } | ||||||||||||||||||||
| 38 | |||||||||||||||||||||
| 39 | 17 | 1; | |||||||||||||||||||
| 40 | |||||||||||||||||||||
| 41 | __END__ | ||||||||||||||||||||
| 42 | |||||||||||||||||||||
| 43 | =pod | ||||||||||||||||||||
| 44 | |||||||||||||||||||||
| 45 | =encoding UTF-8 | ||||||||||||||||||||
| 46 | |||||||||||||||||||||
| 47 | =head1 NAME | ||||||||||||||||||||
| 48 | |||||||||||||||||||||
| 49 | XML::Grammar::FictionBase::Event - a parser event. | ||||||||||||||||||||
| 50 | |||||||||||||||||||||
| 51 | B<For internal use only>. | ||||||||||||||||||||
| 52 | |||||||||||||||||||||
| 53 | =head1 VERSION | ||||||||||||||||||||
| 54 | |||||||||||||||||||||
| 55 | version 0.22.0 | ||||||||||||||||||||
| 56 | |||||||||||||||||||||
| 57 | =head1 SLOTS | ||||||||||||||||||||
| 58 | |||||||||||||||||||||
| 59 | =head2 $event->elem() | ||||||||||||||||||||
| 60 | |||||||||||||||||||||
| 61 | The DOM (Document Object Model) element that the event refers to. See | ||||||||||||||||||||
| 62 | L<XML::Grammar::Fiction::FromProto::Node> . | ||||||||||||||||||||
| 63 | |||||||||||||||||||||
| 64 | =head2 $event->tag_elem() | ||||||||||||||||||||
| 65 | |||||||||||||||||||||
| 66 | Extra tag_elem. | ||||||||||||||||||||
| 67 | |||||||||||||||||||||
| 68 | =head2 $event->type() | ||||||||||||||||||||
| 69 | |||||||||||||||||||||
| 70 | A string specifying the type. | ||||||||||||||||||||
| 71 | |||||||||||||||||||||
| 72 | =head2 tag | ||||||||||||||||||||
| 73 | |||||||||||||||||||||
| 74 | An optional string (or undef) with the tag name. | ||||||||||||||||||||
| 75 | |||||||||||||||||||||
| 76 | =head1 METHODS | ||||||||||||||||||||
| 77 | |||||||||||||||||||||
| 78 | =head2 $event->is_tag_of_name($name) | ||||||||||||||||||||
| 79 | |||||||||||||||||||||
| 80 | Determines if the $event is a tag and of name $name. | ||||||||||||||||||||
| 81 | |||||||||||||||||||||
| 82 | =head2 $event->is_open() | ||||||||||||||||||||
| 83 | |||||||||||||||||||||
| 84 | Returns true if the $event 's type is "open". | ||||||||||||||||||||
| 85 | |||||||||||||||||||||
| 86 | =head2 $event->is_open_or_close() | ||||||||||||||||||||
| 87 | |||||||||||||||||||||
| 88 | Returns true if the $event 's type is either "open" or "close". | ||||||||||||||||||||
| 89 | |||||||||||||||||||||
| 90 | =head2 $self->meta() | ||||||||||||||||||||
| 91 | |||||||||||||||||||||
| 92 | Leftover from Moo. | ||||||||||||||||||||
| 93 | |||||||||||||||||||||
| 94 | =for :stopwords cpan testmatrix url bugtracker rt cpants kwalitee diff irc mailto metadata placeholders metacpan | ||||||||||||||||||||
| 95 | |||||||||||||||||||||
| 96 | =head1 SUPPORT | ||||||||||||||||||||
| 97 | |||||||||||||||||||||
| 98 | =head2 Websites | ||||||||||||||||||||
| 99 | |||||||||||||||||||||
| 100 | The following websites have more information about this module, and may be of help to you. As always, | ||||||||||||||||||||
| 101 | in addition to those websites please use your favorite search engine to discover more resources. | ||||||||||||||||||||
| 102 | |||||||||||||||||||||
| 103 | =over 4 | ||||||||||||||||||||
| 104 | |||||||||||||||||||||
| 105 | =item * | ||||||||||||||||||||
| 106 | |||||||||||||||||||||
| 107 | MetaCPAN | ||||||||||||||||||||
| 108 | |||||||||||||||||||||
| 109 | A modern, open-source CPAN search engine, useful to view POD in HTML format. | ||||||||||||||||||||
| 110 | |||||||||||||||||||||
| 111 | L<https://metacpan.org/release/XML-Grammar-Fiction> | ||||||||||||||||||||
| 112 | |||||||||||||||||||||
| 113 | =item * | ||||||||||||||||||||
| 114 | |||||||||||||||||||||
| 115 | RT: CPAN's Bug Tracker | ||||||||||||||||||||
| 116 | |||||||||||||||||||||
| 117 | The RT ( Request Tracker ) website is the default bug/issue tracking system for CPAN. | ||||||||||||||||||||
| 118 | |||||||||||||||||||||
| 119 | L<https://rt.cpan.org/Public/Dist/Display.html?Name=XML-Grammar-Fiction> | ||||||||||||||||||||
| 120 | |||||||||||||||||||||
| 121 | =item * | ||||||||||||||||||||
| 122 | |||||||||||||||||||||
| 123 | CPANTS | ||||||||||||||||||||
| 124 | |||||||||||||||||||||
| 125 | The CPANTS is a website that analyzes the Kwalitee ( code metrics ) of a distribution. | ||||||||||||||||||||
| 126 | |||||||||||||||||||||
| 127 | L<http://cpants.cpanauthors.org/dist/XML-Grammar-Fiction> | ||||||||||||||||||||
| 128 | |||||||||||||||||||||
| 129 | =item * | ||||||||||||||||||||
| 130 | |||||||||||||||||||||
| 131 | CPAN Testers | ||||||||||||||||||||
| 132 | |||||||||||||||||||||
| 133 | The CPAN Testers is a network of smoke testers who run automated tests on uploaded CPAN distributions. | ||||||||||||||||||||
| 134 | |||||||||||||||||||||
| 135 | L<http://www.cpantesters.org/distro/X/XML-Grammar-Fiction> | ||||||||||||||||||||
| 136 | |||||||||||||||||||||
| 137 | =item * | ||||||||||||||||||||
| 138 | |||||||||||||||||||||
| 139 | CPAN Testers Matrix | ||||||||||||||||||||
| 140 | |||||||||||||||||||||
| 141 | The CPAN Testers Matrix is a website that provides a visual overview of the test results for a distribution on various Perls/platforms. | ||||||||||||||||||||
| 142 | |||||||||||||||||||||
| 143 | L<http://matrix.cpantesters.org/?dist=XML-Grammar-Fiction> | ||||||||||||||||||||
| 144 | |||||||||||||||||||||
| 145 | =item * | ||||||||||||||||||||
| 146 | |||||||||||||||||||||
| 147 | CPAN Testers Dependencies | ||||||||||||||||||||
| 148 | |||||||||||||||||||||
| 149 | The CPAN Testers Dependencies is a website that shows a chart of the test results of all dependencies for a distribution. | ||||||||||||||||||||
| 150 | |||||||||||||||||||||
| 151 | L<http://deps.cpantesters.org/?module=XML::Grammar::Fiction> | ||||||||||||||||||||
| 152 | |||||||||||||||||||||
| 153 | =back | ||||||||||||||||||||
| 154 | |||||||||||||||||||||
| 155 | =head2 Bugs / Feature Requests | ||||||||||||||||||||
| 156 | |||||||||||||||||||||
| 157 | Please report any bugs or feature requests by email to C<bug-xml-grammar-fiction at rt.cpan.org>, or through | ||||||||||||||||||||
| 158 | the web interface at L<https://rt.cpan.org/Public/Bug/Report.html?Queue=XML-Grammar-Fiction>. You will be automatically notified of any | ||||||||||||||||||||
| 159 | progress on the request by the system. | ||||||||||||||||||||
| 160 | |||||||||||||||||||||
| 161 | =head2 Source Code | ||||||||||||||||||||
| 162 | |||||||||||||||||||||
| 163 | The code is open to the world, and available for you to hack on. Please feel free to browse it and play | ||||||||||||||||||||
| 164 | with it, or whatever. If you want to contribute patches, please send me a diff or prod me to pull | ||||||||||||||||||||
| 165 | from your repository :) | ||||||||||||||||||||
| 166 | |||||||||||||||||||||
| 167 | L<https://github.com/shlomif/fiction-xml> | ||||||||||||||||||||
| 168 | |||||||||||||||||||||
| 169 | git clone git://github.com/shlomif/fiction-xml.git | ||||||||||||||||||||
| 170 | |||||||||||||||||||||
| 171 | =head1 AUTHOR | ||||||||||||||||||||
| 172 | |||||||||||||||||||||
| 173 | Shlomi Fish <shlomif@cpan.org> | ||||||||||||||||||||
| 174 | |||||||||||||||||||||
| 175 | =head1 BUGS | ||||||||||||||||||||
| 176 | |||||||||||||||||||||
| 177 | Please report any bugs or feature requests on the bugtracker website | ||||||||||||||||||||
| 178 | L<https://github.com/shlomif/fiction-xml/issues> | ||||||||||||||||||||
| 179 | |||||||||||||||||||||
| 180 | When submitting a bug or request, please include a test-file or a | ||||||||||||||||||||
| 181 | patch to an existing test-file that illustrates the bug or desired | ||||||||||||||||||||
| 182 | feature. | ||||||||||||||||||||
| 183 | |||||||||||||||||||||
| 184 | =head1 COPYRIGHT AND LICENSE | ||||||||||||||||||||
| 185 | |||||||||||||||||||||
| 186 | This software is Copyright (c) 2007 by Shlomi Fish. | ||||||||||||||||||||
| 187 | |||||||||||||||||||||
| 188 | This is free software, licensed under: | ||||||||||||||||||||
| 189 | |||||||||||||||||||||
| 190 | The MIT (X11) License | ||||||||||||||||||||
| 191 | |||||||||||||||||||||
| 192 | =cut | ||||||||||||||||||||