lib/Finance/Robinhood/Equity/Earnings/Report.pm

filter: Statementstmt 75.0% 15 / 20 Branchbran n/a Conditioncond 50.0% 1 / 2 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 83.3% 5 / 6 Podpod 100% 1 / 1 totaltotal 70.9% 22 / 31 CC 2 SCAR 4.9
CC
2
Cov
73%
_test_datel
2.5
date
2.0
_test__init
1.4
CRAP 1.6
« lib/Finance/Robinhood/Equity/PriceMovement.pm ↑ Summary lib/Finance/Robinhood/Options/Chain/Underlying.pm »
1 package Finance::Robinhood::Equity::Earnings::Report;
2  
3 =encoding utf-8
4  
5 =for stopwords watchlist watchlists untradable urls
6  
7 =head1 NAME
8  
9 Finance::Robinhood::Equity::Earnings::Report - Earnings Report Data
10  
11 =head1 SYNOPSIS
12  
13 use Finance::Robinhood;
14 my $rh = Finance::Robinhood->new;
15
16 my $earnings = $rh->equity_earnings;
17  
18 for my $earnings ( $rh->equity_earnings('7d')->all ) {
19 CORE::say 'Earnings for ' . $earnings->symbol . ' expected ' . $earnings->report->date;
20 }
21  
22 =cut
23  
24 1 our $VERSION = '0.92_003';
25  
26 1 ▶sub _test__init {
Subroutine _test__init: called CC=1 SCAR=3.5
27 1 my $rh = t::Utility::rh_instance(1);
28 0 my $report = $rh->equity_earnings(range => -7)->current->report;
29 0 isa_ok($report, __PACKAGE__);
30 0 t::Utility::stash('REPORT', $report);
31 }
32 1 ▶use Mojo::Base-base, -signatures;
Subroutine BEGIN: called CC=1 SCAR=0.0
33 1 ▶use Mojo::URL;
Subroutine BEGIN: called CC=1 SCAR=0.0
34 #
35 1 ▶use Time::Moment;
Subroutine BEGIN: called CC=1 SCAR=0.0
36 #
37 1 has _rh => undef => weak => 1;
38  
39 =head1 METHODS
40  
41 =head2 C<date( )>
42  
43 Returns a Time::Moment object.
44  
45 =cut
46  
47 0 ▶sub date ($s) {
Subroutine date: not called CC=1 SCAR=6.9
Pod documented
48 0 Time::Moment->from_string($s->{date} . 'T00:00:00Z');
49 }
50  
51 1 ▶sub _test_datel {
Subroutine _test_datel: called CC=2 SCAR=9.2
52 1 ▶ t::Utility::stash('REPORT') // skip_all();
Condition50%1/2
t::Utility::stash("REPORT") // skip_all()
l!l
01
MC/DC0%0/2
t::Utility::stash("REPORT") // skip_all()
t::Utility::stash("REPORT") skip_all()
Truth table33%1/3
A // B
A= t::Utility::stash("REPORT")B= skip_all()
ABresult
1X1
011
000
53 0 isa_ok(t::Utility::stash('REPORT')->date(), 'Time::Moment');
54 }
55  
56 =head2 C<timing( )>
57  
58 Returns when during the trading day the data and call are expected. Options
59 include C<am> and C<pm>.
60  
61 =head2 C<verified( )>
62  
63 This returns true when the earnings release has verified to take place as
64 expected.
65  
66 =cut
67  
68 1 has ['timing', 'verified'];
69  
70 =head1 LEGAL
71  
72 This is a simple wrapper around the API used in the official apps. The author
73 provides no investment, legal, or tax advice and is not responsible for any
74 damages incurred while using this software. This software is not affiliated
75 with Robinhood Financial LLC in any way.
76  
77 For Robinhood's terms and disclosures, please see their website at
78 https://robinhood.com/legal/
79  
80 =head1 LICENSE
81  
82 Copyright (C) Sanko Robinson.
83  
84 This library is free software; you can redistribute it and/or modify it under
85 the terms found in the Artistic License 2. Other copyrights, terms, and
86 conditions may apply to data transmitted through this module. Please refer to
87 the L<LEGAL> section.
88  
89 =head1 AUTHOR
90  
91 Sanko Robinson E<lt>sanko@cpan.orgE<gt>
92  
93 =cut
94  
95 1 1;
« lib/Finance/Robinhood/Equity/PriceMovement.pm ↑ Summary lib/Finance/Robinhood/Options/Chain/Underlying.pm »