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_003';
25 1     1   7 use Mojo::Base-base, -signatures;
  1         2  
  1         7  
26 1     1   257 use Mojo::URL;
  1         2  
  1         6  
27              
28             sub _test__init {
29 1     1   12688 my $rh = t::Utility::rh_instance(0);
30 1         15 my $ticks = $rh->options_chains->current->min_ticks;
31 1         935 isa_ok($ticks, __PACKAGE__);
32 1         445 t::Utility::stash('TICKS', $ticks); # Store it for later
33             }
34 1     1   149 use overload '""' => sub ($s, @) { $s->{below_tick} }, fallback => 1;
  1     2   3  
  1         13  
  2         3  
  2         16  
  2         366  
  2         4  
35              
36             sub _test_stringify {
37 1   50 1   2297 t::Utility::stash('TICKS') // skip_all();
38 1         4 like(+t::Utility::stash('TICKS'), qr[^\d+\.\d+$],);
39             }
40             #
41             has _rh => undef => weak => 1;
42              
43             =head2 C
44              
45             Value to 'round up' to.
46              
47             =head2 C
48              
49             Value to 'round down' to.
50              
51             =head2 C
52              
53             Below this, use the C and C values. Otherwise,
54             ignore them.
55              
56             =cut
57              
58             has ['above_tick', 'below_tick', 'cutoff_price'];
59              
60             =head1 LEGAL
61              
62             This is a simple wrapper around the API used in the official apps. The author
63             provides no investment, legal, or tax advice and is not responsible for any
64             damages incurred while using this software. This software is not affiliated
65             with Robinhood Financial LLC in any way.
66              
67             For Robinhood's terms and disclosures, please see their website at
68             https://robinhood.com/legal/
69              
70             =head1 LICENSE
71              
72             Copyright (C) Sanko Robinson.
73              
74             This library is free software; you can redistribute it and/or modify it under
75             the terms found in the Artistic License 2. Other copyrights, terms, and
76             conditions may apply to data transmitted through this module. Please refer to
77             the L section.
78              
79             =head1 AUTHOR
80              
81             Sanko Robinson Esanko@cpan.orgE
82              
83             =cut
84              
85             1;