File Coverage

lib/Finance/Alpaca/Struct/Position.pm
Criterion Covered Total %
statement 33 33 100.0
branch n/a
condition n/a
subroutine 11 11 100.0
pod n/a
total 44 44 100.0


line stmt bran cond sub pod time code
1             package Finance::Alpaca::Struct::Position 0.9902 {
2 17     17   111 use strictures 2;
  17         143  
  17         674  
3 17     17   3636 use feature 'signatures';
  17         30  
  17         1370  
4 17     17   92 no warnings 'experimental::signatures';
  17         32  
  17         687  
5             #
6 17     17   86 use Type::Library 0.008 -base, -declare => qw[Position];
  17         343  
  17         98  
7 17     17   6787 use Type::Utils;
  17         35  
  17         129  
8 17     17   22108 use Types::Standard qw[Bool Enum Int Num Ref Str];
  17         36  
  17         137  
9 17     17   20284 use Types::TypeTiny 0.004 StringLike => { -as => "Stringable" };
  17         332  
  17         110  
10             class_type Position, { class => __PACKAGE__ };
11             coerce( Position, from Ref() => __PACKAGE__ . q[->new($_)] );
12             #
13 17     17   5198 use Moo;
  17         35  
  17         137  
14 17     17   5745 use Types::UUID;
  17         33  
  17         114  
15 17     17   5103 use lib './lib';
  17         30  
  17         124  
16 17     17   2679 use Finance::Alpaca::Types;
  17         30  
  17         122  
17             has asset_id => ( is => 'ro', isa => Uuid, required => 1 );
18             has [qw[asset_class symbol]] => ( is => 'ro', isa => Str, required => 1 );
19             has exchange =>
20             ( is => 'ro', isa => Enum [qw[AMEX ARCA BATS NYSE NASDAQ NYSEARCA OTC]], required => 1 );
21              
22             has [
23             qw[avg_entry_price change_today cost_basis current_price lastday_price market_value qty unrealized_intraday_pl unrealized_intraday_plpc unrealized_pl unrealized_plpc]
24             ] => ( is => 'ro', isa => Num, required => 1 );
25             has side => ( is => 'ro', isa => Enum [qw[long short]], required => 1 );
26              
27             }
28             1;
29             __END__