File Coverage

lib/Finance/Robinhood/Equity/Earnings/Report.pm
Criterion Covered Total %
statement 11 19 57.8
branch n/a
condition 1 2 50.0
subroutine 5 6 83.3
pod 1 1 100.0
total 18 28 64.2


line stmt bran cond sub pod time code
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             our $VERSION = '0.92_003';
25              
26             sub _test__init {
27 1     1   11245 my $rh = t::Utility::rh_instance(1);
28 0         0 my $report = $rh->equity_earnings(range => -7)->current->report;
29 0         0 isa_ok($report, __PACKAGE__);
30 0         0 t::Utility::stash('REPORT', $report);
31             }
32 1     1   8 use Mojo::Base-base, -signatures;
  1         4  
  1         9  
33 1     1   194 use Mojo::URL;
  1         3  
  1         6  
34             #
35 1     1   33 use Time::Moment;
  1         2  
  1         159  
36             #
37             has _rh => undef => weak => 1;
38              
39             =head1 METHODS
40              
41             =head2 C
42              
43             Returns a Time::Moment object.
44              
45             =cut
46              
47 0     0 1 0 sub date ($s) {
  0         0  
  0         0  
48 0         0 Time::Moment->from_string($s->{date} . 'T00:00:00Z');
49             }
50              
51             sub _test_datel {
52 1   50 1   2009 t::Utility::stash('REPORT') // skip_all();
53 0           isa_ok(t::Utility::stash('REPORT')->date(), 'Time::Moment');
54             }
55              
56             =head2 C
57              
58             Returns when during the trading day the data and call are expected. Options
59             include C and C.
60              
61             =head2 C
62              
63             This returns true when the earnings release has verified to take place as
64             expected.
65              
66             =cut
67              
68             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 section.
88              
89             =head1 AUTHOR
90              
91             Sanko Robinson Esanko@cpan.orgE
92              
93             =cut
94              
95             1;