File Coverage

blib/lib/Rose/DB/Object/ConventionManager/Null.pm
Criterion Covered Total %
statement 8 8 100.0
branch n/a
condition 2 3 66.6
subroutine 3 17 17.6
pod 13 15 86.6
total 26 43 60.4


line stmt bran cond sub pod time code
1             package Rose::DB::Object::ConventionManager::Null;
2              
3 61     61   530 use strict;
  61         227  
  61         6327  
4              
5 61     61   418 use Rose::DB::Object::ConventionManager;
  61         140  
  61         13800  
6             our @ISA = qw(Rose::DB::Object::ConventionManager);
7              
8             our $VERSION = '0.73';
9              
10             our $Instance;
11              
12             # This class is a singleton
13             sub new
14             {
15 4     4 1 47 my($class) = shift;
16 4   66     43 return $Instance ||= $class->SUPER::new(@_);
17             }
18              
19       0 1   sub class_to_table_singular { }
20       0 0   sub class_suffix { }
21       0 1   sub class_to_table_plural { }
22       0 0   sub table_to_class_plural { }
23       0 1   sub table_to_class { }
24       0 1   sub class_prefix { }
25       0 1   sub related_table_to_class { }
26       0 1   sub auto_table_name { }
27       0 1   sub auto_primary_key_column_names { }
28       0 1   sub singular_to_plural { }
29       0 1   sub plural_to_singular { }
30       0 1   sub auto_foreign_key_name { }
31       0 1   sub auto_foreign_key { }
32       0 1   sub auto_relationship { }
33              
34             1;
35              
36             __END__
37              
38             =head1 NAME
39              
40             Rose::DB::Object::ConventionManager::Null - A singleton convention manager that does nothing.
41              
42             =head1 SYNOPSIS
43              
44             package My::Product;
45              
46             use Rose::DB::Object;
47             our @ISA = qw(Rose::DB::Object);
48              
49             # This really sets the convention manager to a
50             # Rose::DB::Object::ConventionManager::Null object
51             __PACKAGE__->meta->convention_manager(undef);
52             ...
53              
54             =head1 DESCRIPTION
55              
56             L<Rose::DB::Object::ConventionManager::Null> is a subclass of L<Rose::DB::Object::ConventionManager> that does nothing. That is, it overrides every method with no-ops that always return undef or an empty list, depending on calling context. This class is a singleton.
57              
58             When a piece of L<metadata|Rose::DB::Object::Metadata> is missing, the convention manager is asked to provide it. This "null" convention manager class is useful if you do not want the convention manager to provide any information. In other words, use this convention manager class if you want to force all L<metadata|Rose::DB::Object::Metadata> to be explicitly specified.
59              
60             See the L<Rose::DB::Object::ConventionManager> documentation for more information on convention managers.
61              
62             =head1 AUTHOR
63              
64             John C. Siracusa (siracusa@gmail.com)
65              
66             =head1 LICENSE
67              
68             Copyright (c) 2010 by John C. Siracusa. All rights reserved. This program is
69             free software; you can redistribute it and/or modify it under the same terms
70             as Perl itself.