File Coverage

blib/lib/Devel/PerlySense/Bookmark/Match.pm
Criterion Covered Total %
statement 38 38 100.0
branch n/a
condition n/a
subroutine 11 11 100.0
pod 1 1 100.0
total 50 50 100.0


line stmt bran cond sub pod time code
1             =head1 NAME
2              
3             Devel::PerlySense::Bookmark::Match - A Bookmark match
4              
5             =head1 DESCRIPTION
6              
7             A match has a Location (file + line), and a corresponding Definition
8             that caused it to match.
9              
10             =cut
11              
12              
13              
14              
15              
16 68     68   239 use strict;
  68         83  
  68         1543  
17 68     68   206 use warnings;
  68         76  
  68         1224  
18 68     68   191 use utf8;
  68         77  
  68         272  
19              
20             package Devel::PerlySense::Bookmark::Match;
21             $Devel::PerlySense::Bookmark::Match::VERSION = '0.0217';
22              
23              
24              
25              
26 68     68   2663 use Spiffy -Base;
  68         72  
  68         341  
27 68     68   31358 use Carp;
  68     68   86  
  68     68   1058  
  68         188  
  68         82  
  68         1309  
  68         192  
  68         81  
  68         2857  
28 68     68   236 use Data::Dumper;
  68         105  
  68         2106  
29              
30 68     68   227 use Devel::PerlySense;
  68         92  
  68         657  
31 68     68   11452 use Devel::PerlySense::Document::Location;
  68         87  
  68         258  
32              
33              
34              
35              
36              
37             =head1 PROPERTIES
38              
39             =head2 oLocation
40              
41             The Document::Location where this match matched.
42              
43             =cut
44             field "oLocation" => undef;
45              
46              
47              
48              
49              
50             =head2 oDefinition
51              
52             Bookmark::Definition that was used to match this.
53              
54             =cut
55             field "oDefinition" => undef;
56              
57              
58              
59              
60              
61             =head2 line
62              
63             The source line where the match matched.
64              
65             Default: ""
66              
67             =cut
68             field "line" => "";
69              
70              
71              
72              
73              
74             =head2 text
75              
76             The textual match that was captured (or the entire line).
77              
78             Default: ""
79              
80             =cut
81             field "text" => "";
82              
83              
84              
85              
86              
87             =head1 METHODS
88              
89             =head2 new(file, row, line, text, oDefinition)
90              
91             Create new PerlySense::Bookmark::Match object.
92              
93             =cut
94 14     14 1 15 sub new {
95 14         53 my ($file, $row, $line, $text, $oDefinition) = Devel::PerlySense::Util::aNamedArg(["file", "row", "line", "text", "oDefinition"], @_);
96              
97 14         32 $self = bless {}, $self; #Create the object. It looks weird because of Spiffy
98 14         47 $self->oLocation(Devel::PerlySense::Document::Location->new(
99             file => $file,
100             row => $row,
101             col => 0, #When a col is needed, add it here
102             ));
103 14         219 $self->oDefinition($oDefinition);
104 14         207 $self->line($line);
105 14         220 $self->text($text);
106              
107 14         74 return($self);
108             }
109              
110              
111              
112              
113              
114             1;
115              
116              
117              
118              
119              
120             __END__
121              
122             =encoding utf8
123              
124             =head1 AUTHOR
125              
126             Johan Lindstrom, C<< <johanl@cpan.org> >>
127              
128             =head1 BUGS
129              
130             Please report any bugs or feature requests to
131             C<bug-devel-perlysense@rt.cpan.org>, or through the web interface at
132             L<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Devel-PerlySense>.
133             I will be notified, and then you'll automatically be notified of progress on
134             your bug as I make changes.
135              
136             =head1 ACKNOWLEDGEMENTS
137              
138             =head1 COPYRIGHT & LICENSE
139              
140             Copyright 2005 Johan Lindstrom, All Rights Reserved.
141              
142             This program is free software; you can redistribute it and/or modify it
143             under the same terms as Perl itself.
144              
145             =cut