File Coverage

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 63     63   219 use strict;
  63         71  
  63         1710  
17 63     63   225 use warnings;
  63         72  
  63         1316  
18 63     63   213 use utf8;
  63         90  
  63         259  
19              
20             package Devel::PerlySense::Bookmark::Match;
21              
22              
23              
24              
25              
26 63     63   2289 use Spiffy -Base;
  63         99  
  63         1588  
27 63     63   35437 use Carp;
  63     63   82  
  63     63   1658  
  63         219  
  63         81  
  63         1450  
  63         218  
  63         98  
  63         3193  
28 63     63   232 use Data::Dumper;
  63         94  
  63         2365  
29              
30 63     63   233 use Devel::PerlySense;
  63         89  
  63         371  
31 63     63   13256 use Devel::PerlySense::Document::Location;
  63         81  
  63         361  
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 20 sub new {
95 14         67 my ($file, $row, $line, $text, $oDefinition) = Devel::PerlySense::Util::aNamedArg(["file", "row", "line", "text", "oDefinition"], @_);
96              
97 14         177 $self = bless {}, $self; #Create the object. It looks weird because of Spiffy
98 14         60 $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         384 $self->oDefinition($oDefinition);
104 14         359 $self->line($line);
105 14         392 $self->text($text);
106              
107 14         94 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 Lindström, C<< <johanl[ÄT]DarSerMan.com> >>
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 Lindström, 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