File Coverage

blib/lib/Statistics/R/REXP/Language.pm
Criterion Covered Total %
statement 18 18 100.0
branch 2 2 100.0
condition 4 6 66.6
subroutine 8 8 100.0
pod 1 2 50.0
total 33 36 91.6


line stmt bran cond sub pod time code
1             package Statistics::R::REXP::Language;
2             # ABSTRACT: an R language vector
3             $Statistics::R::REXP::Language::VERSION = '1.0002';
4 16     16   46258 use 5.010;
  16         47  
5              
6 16     16   78 use Scalar::Util qw(blessed);
  16         25  
  16         621  
7              
8 16     16   344 use Class::Tiny::Antlers;
  16         3025  
  16         91  
9 16     16   1991 use namespace::clean;
  16         8573  
  16         85  
10              
11             extends 'Statistics::R::REXP::List';
12              
13 16     16   3532 use constant sexptype => 'LANGSXP';
  16         31  
  16         2467  
14              
15              
16             sub BUILD {
17 635     635 0 17173 my ($self, $args) = @_;
18              
19             # Required attribute type
20 635 100 66     9361 die 'The first element must be a Symbol or Language' if defined $self->elements &&
      66        
21             !(blessed $self->elements->[0] &&
22             ($self->elements->[0]->isa('Statistics::R::REXP::Language') ||
23             $self->elements->[0]->isa('Statistics::R::REXP::Symbol')))
24             }
25              
26             sub to_pl {
27 6     6 1 603 Statistics::R::REXP::Vector::to_pl(@_)
28             }
29              
30 38     38   88 sub _type { 'language' };
31              
32              
33             1; # End of Statistics::R::REXP::Language
34              
35             __END__