File Coverage

lib/Finance/Alpaca/Struct/TradeUpdate.pm
Criterion Covered Total %
statement 36 36 100.0
branch n/a
condition n/a
subroutine 12 12 100.0
pod n/a
total 48 48 100.0


line stmt bran cond sub pod time code
1             package Finance::Alpaca::Struct::TradeUpdate 0.9902 {
2 1     1   8 use strictures 2;
  1         7  
  1         40  
3 1     1   173 use feature 'signatures';
  1         1  
  1         59  
4 1     1   5 no warnings 'experimental::signatures';
  1         1  
  1         42  
5             #
6 1     1   5 use Type::Library 0.008 -base, -declare => qw[TradeUpdate];
  1         16  
  1         6  
7 1     1   441 use Type::Utils;
  1         2  
  1         5  
8 1     1   1494 use Types::Standard qw[Enum Num Ref Str];
  1         2  
  1         7  
9 1     1   1195 use Types::TypeTiny 0.004 StringLike => { -as => "Stringable" };
  1         16  
  1         6  
10             class_type TradeUpdate, { class => __PACKAGE__ };
11             coerce( TradeUpdate, from Ref() => __PACKAGE__ . q[->new($_)] );
12             #
13 1     1   350 use Moo;
  1         2  
  1         6  
14 1     1   313 use Types::UUID;
  1         2  
  1         6  
15 1     1   354 use lib './lib';
  1         2  
  1         5  
16 1     1   141 use Finance::Alpaca::Types;
  1         2  
  1         7  
17 1     1   325 use Finance::Alpaca::Struct::Order qw[Order];
  1         3  
  1         8  
18             has event => (
19             is => 'ro',
20             isa => Enum [
21             qw[
22             new fill partial_fill canceled expired done_for_day replaced
23             rejected pending_new stopped pending_cancel pending_replace
24             calculated suspended
25             order_replace_rejected order_cancel_rejected]
26             ],
27             required => 1
28             );
29             has order => ( is => 'ro', isa => Order, required => 1, coerce => 1 );
30             has timestamp => ( is => 'ro', isa => Timestamp, predicate => 1, coerce => 1 );
31             has [qw[position_qty price qty]] => ( is => 'ro', isa => Num, predicate => 1 );
32             }
33             1;
34             __END__