File Coverage

blib/lib/Search/Tools/Object.pm
Criterion Covered Total %
statement 6 6 100.0
branch n/a
condition n/a
subroutine 2 2 100.0
pod n/a
total 8 8 100.0


line stmt bran cond sub pod time code
1             package Search::Tools::Object;
2 33     33   13565 use Moo;
  33         67  
  33         154  
3 33     33   9307 use namespace::autoclean;
  33         20719  
  33         184  
4              
5             has 'debug' => (
6             is => 'rw',
7             default => sub { $ENV{PERL_DEBUG} || 0 },
8             coerce => sub {
9             return 0 if !$_[0]; # allow for undef or zero
10             return $_[0];
11             }
12             );
13              
14             our $VERSION = '1.006';
15              
16             1;
17              
18             =pod
19              
20             =head1 NAME
21              
22             Search::Tools::Object - base class for Search::Tools objects
23              
24             =head1 SYNOPSIS
25              
26             package MyClass;
27             use Moo;
28             extends 'Search::Tools::Object';
29             has 'foo' => ( is => 'rw' );
30             has 'bar' => ( is => 'rw' );
31            
32             1;
33            
34             # elsewhere
35            
36             use MyClass;
37             my $object = MyClass->new;
38             $object->foo(123);
39             print $object->bar . "\n";
40              
41             =head1 DESCRIPTION
42              
43             Search::Tools::Object is a simple Moo subclass.
44              
45             Prior to version 1.00 STO was a subclass of Rose::ObjectX::CAF.
46              
47             Prior to version 0.24 STO was a subclass of Class::Accessor::Fast.
48              
49             =head1 METHODS
50              
51             =head2 debug( I )
52              
53             Get/set the debug value for the object. All objects inherit this attribute.
54             You can use the C env var to set this value as well.
55              
56             =head1 AUTHOR
57              
58             Peter Karman C<< >>
59              
60             =head1 BUGS
61              
62             Please report any bugs or feature requests to C, or through
63             the web interface at L.
64             I will be notified, and then you'll
65             automatically be notified of progress on your bug as I make changes.
66              
67             =head1 SUPPORT
68              
69             You can find documentation for this module with the perldoc command.
70              
71             perldoc Search::Tools
72              
73              
74             You can also look for information at:
75              
76             =over 4
77              
78             =item * RT: CPAN's request tracker
79              
80             L
81              
82             =item * AnnoCPAN: Annotated CPAN documentation
83              
84             L
85              
86             =item * CPAN Ratings
87              
88             L
89              
90             =item * Search CPAN
91              
92             L
93              
94             =back
95              
96             =head1 COPYRIGHT
97              
98             Copyright 2009 by Peter Karman.
99              
100             This package is free software; you can redistribute it and/or modify it under the
101             same terms as Perl itself.
102              
103             =head1 SEE ALSO
104              
105             Search::QueryParser