| 1 | package Finance::Robinhood::Options::Order::Leg; | ||||||||||||||
| 2 | 3 | ▶ | use Moo; | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 3 | # | ||||||||||||||
| 4 | 3 | ▶ | use Finance::Robinhood::Options::Order::Leg::Execution; | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 5 | # | ||||||||||||||
| 6 | 3 | has [qw[side position_effect id ratio_quantity]] => ( is => 'ro' ); | |||||||||||||
| 7 | has '_option_url' => ( | ||||||||||||||
| 8 | is => 'ro', | ||||||||||||||
| 9 | init_arg => 'option', | ||||||||||||||
| 10 | coerce => sub { | ||||||||||||||
| 11 | |||||||||||||||
| 12 | # If created by user, accept object | ||||||||||||||
| 13 | # If created by /options/order/ API call, accept plain url | ||||||||||||||
| 14 | 0 | ▶ | ref $_[0] ? $_[0]->url : $_[0]; | ||||||||||||
|
Subroutine
__ANON__: not called CC=2 SCAR=17.9
Branch: 1 branch
| |||||||||||||||
| 15 | } | ||||||||||||||
| 16 | 3 | ); | |||||||||||||
| 17 | has 'option' => ( | ||||||||||||||
| 18 | is => 'ro', | ||||||||||||||
| 19 | lazy => 1, | ||||||||||||||
| 20 | init_arg => undef, | ||||||||||||||
| 21 | builder => sub { | ||||||||||||||
| 22 | 0 | ▶ | my ( $status, $data ) | ||||||||||||
|
Subroutine
_build_option: not called CC=2 SCAR=17.9
Subroutine
__ANON__: not called CC=2 SCAR=17.9
| |||||||||||||||
| 23 | = Finance::Robinhood::Utils::Client->instance->get( shift->_option_url ); | ||||||||||||||
| 24 | 0 | ▶ | $status == 200 ? Finance::Robinhood::Options::Instrument->new($data) : (); | ||||||||||||
|
Branch: 2 branches
| |||||||||||||||
| 25 | } | ||||||||||||||
| 26 | 3 | ); | |||||||||||||
| 27 | has 'executions' => ( | ||||||||||||||
| 28 | is => 'ro', | ||||||||||||||
| 29 | coerce => sub { | ||||||||||||||
| 30 | 0 | ▶ | [ map { Finance::Robinhood::Options::Order::Leg::Execution->new($_) } @{ $_[0] } ]; | ||||||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||||||
| 31 | } | ||||||||||||||
| 32 | 3 | ); | |||||||||||||
| 33 | 3 | 1; | |||||||||||||