File Coverage

lib/DBIx/ActiveRecord/Arel/Column.pm
Criterion Covered Total %
statement 13 13 100.0
branch 2 2 100.0
condition 2 3 66.6
subroutine 5 5 100.0
pod 0 3 0.0
total 22 26 84.6


line stmt bran cond sub pod time code
1             package DBIx::ActiveRecord::Arel::Column;
2 2     2   12 use strict;
  2         3  
  2         80  
3 2     2   10 use warnings;
  2         4  
  2         691  
4              
5             our $USE_FULL_NAME = 0;
6             our $AS = {};
7              
8             sub new {
9 119     119 0 167 my ($self, $table, $column) = @_;
10 119         1185 bless {table => $table, column => $column}, $self;
11             }
12              
13 153     153 0 402 sub table {shift->{table}}
14              
15             sub name {
16 121     121 0 133 my $self = shift;
17 121 100       158 if ($USE_FULL_NAME) {
18 69   66     192 ($AS->{$self->table->table}||$self->table->table).'.'.$self->{column};
19             } else {
20 52         224 $self->{column};
21             }
22             }
23              
24             1;