File Coverage

lib/Finance/Robinhood/Options/Chain/Ticks.pm
Criterion Covered Total %
statement 19 19 100.0
branch n/a
condition 1 2 50.0
subroutine 6 6 100.0
pod n/a
total 26 27 96.3


line stmt bran cond sub pod time code
1             package Finance::Robinhood::Options::Chain::Ticks;
2              
3             =encoding utf-8
4              
5             =for stopwords watchlist watchlists untradable urls
6              
7             =head1 NAME
8              
9             Finance::Robinhood::Options::Chain::Ticks - Represents Pricing Ticks for an
10             Options Chain
11              
12             =head1 SYNOPSIS
13              
14             use Text::Wrap qw[wrap];
15             use Finance::Robinhood;
16             my $rh = Finance::Robinhood->new;
17              
18             # TODO
19              
20             =head1 METHODS
21              
22             =cut
23              
24             our $VERSION = '0.92_001';
25              
26 1     1   7 use Mojo::Base-base, -signatures;
  1         2  
  1         7  
27 1     1   186 use Mojo::URL;
  1         2  
  1         6  
28              
29             sub _test__init {
30 1     1   12573 my $rh = t::Utility::rh_instance(0);
31 1         15 my $ticks = $rh->options_chains->current->min_ticks;
32 1         1434 isa_ok( $ticks, __PACKAGE__ );
33 1         489 t::Utility::stash( 'TICKS', $ticks ); # Store it for later
34             }
35              
36 1     1   172 use overload '""' => sub ( $s, @ ) { $s->{below_tick} }, fallback => 1;
  1     2   2  
  1         12  
  2         4  
  2         18  
  2         368  
  2         4  
37              
38             sub _test_stringify {
39 1   50 1   2293 t::Utility::stash('TICKS') // skip_all();
40 1         5 like(
41             +t::Utility::stash('TICKS'),
42             qr[^\d+\.\d+$],
43             );
44             }
45             #
46             has _rh => undef => weak => 1;
47              
48             =head2 C
49              
50             Value to 'round up' to.
51              
52             =head2 C
53              
54             Value to 'round down' to.
55              
56             =head2 C
57              
58             Below this, use the C and C values. Otherwise,
59             ignore them.
60              
61             =cut
62              
63             has [ 'above_tick', 'below_tick', 'cutoff_price' ];
64              
65             =head1 LEGAL
66              
67             This is a simple wrapper around the API used in the official apps. The author
68             provides no investment, legal, or tax advice and is not responsible for any
69             damages incurred while using this software. This software is not affiliated
70             with Robinhood Financial LLC in any way.
71              
72             For Robinhood's terms and disclosures, please see their website at
73             https://robinhood.com/legal/
74              
75             =head1 LICENSE
76              
77             Copyright (C) Sanko Robinson.
78              
79             This library is free software; you can redistribute it and/or modify it under
80             the terms found in the Artistic License 2. Other copyrights, terms, and
81             conditions may apply to data transmitted through this module. Please refer to
82             the L section.
83              
84             =head1 AUTHOR
85              
86             Sanko Robinson Esanko@cpan.orgE
87              
88             =cut
89              
90             1;