File Coverage: lib/Code/Statistics/Metric/size.pm

# File Coverage

File: | lib/Code/Statistics/Metric/size.pm
Coverage: | 100.0%

line | stmt | bran | cond | sub | pod | time | code
--- | --- | --- | --- | --- | --- | --- | ---
1 | 2 2 2 |  |  | 2 |  | 0 0 0 | use strict;
2 | 2 2 2 |  |  | 2 |  | 0 0 0 | use warnings;
3 |
4 |  |  |  |  |  |  | package Code::Statistics::Metric::size;
5 |
6 |  |  |  |  |  |  | # ABSTRACT: measures the byte size of a target
7 |
8 | 2 2 2 |  |  | 2 |  | 0 0 0 | use Moose;
9 |  |  |  |  |  |  | extends 'Code::Statistics::Metric';
10 |
11 - 13 |  |
    =head2 measure
        Returns the byte size of the given target.
    =cut
14 |
15 |  |  |  |  |  |  | sub measure {
16 |  |  |  |  |  |  | my ( $class, $target ) = @_;
17 |  |  |  |  |  |  | my $size = length $target->content;
18 |  |  |  |  |  |  | return $size;
19 |  |  |  |  |  |  | }
20 |
21 |  |  |  |  |  |  | 1;