File Coverage

lib/Finance/Robinhood/Forex/Quote.pm
Criterion Covered Total %
statement 14 22 63.6
branch n/a
condition 1 2 50.0
subroutine 6 7 85.7
pod 0 1 0.0
total 21 32 65.6


line stmt bran cond sub pod time code
1             package Finance::Robinhood::Forex::Quote;
2              
3             =encoding utf-8
4              
5             =for stopwords watchlist watchlists untradable urls
6              
7             =head1 NAME
8              
9             Finance::Robinhood::Forex::Quote - Represents Quote Data for a Single Forex
10             Currency Pair
11              
12             =head1 SYNOPSIS
13              
14             use Finance::Robinhood;
15             my $rh = Finance::Robinhood->new;
16            
17             # TODO
18              
19             =cut
20              
21             our $VERSION = '0.92_001';
22 1     1   7 use Mojo::Base-base, -signatures;
  1         2  
  1         8  
23 1     1   220 use Mojo::URL;
  1         2  
  1         6  
24 1     1   24 use Time::Moment;
  1         2  
  1         31  
25 1     1   6 use Finance::Robinhood::Forex::Pair;
  1         2  
  1         9  
26              
27             sub _test__init {
28 1     1   11362 my $rh = t::Utility::rh_instance(1);
29 0         0 my $quote = $rh->forex_pairs->current->quote();
30 0         0 isa_ok( $quote, __PACKAGE__ );
31 0         0 t::Utility::stash( 'QUOTE', $quote ); # Store it for later
32             }
33             #
34             has _rh => undef => weak => 1;
35              
36             =head1 METHODS
37              
38              
39             =head2 C
40              
41             Live ask price.
42              
43             =head2 C
44              
45             Delayed bid price.
46              
47             =head2 C
48              
49             Period high price.
50              
51             =head2 C
52              
53             Period low price.
54              
55             =head2 C
56              
57             Spread midpoint.
58              
59             =head2 C
60              
61             Period open price.
62              
63             =head2 C
64              
65             The ticker symbol of the currency pair related to this quote data. See C
66             )> to be given the object itself.
67              
68             =head2 C
69              
70             Volume traded during period.
71              
72             =cut
73              
74             has [
75             'ask_price', 'bid_price', 'high_price', 'id', 'low_price', 'mark_price',
76             'open_price', 'symbol', 'volume'
77             ];
78              
79             =head2 C
80              
81             my $instrument = $quote->instrument();
82              
83             Loops back to a Finance::Robinhood::Forex::Instrument object.
84              
85             =cut
86              
87 0     0 0 0 sub pair ($s) {
  0         0  
  0         0  
88 0         0 return $s->_rh->forex_pair_by_id( $s->{id} );
89             }
90              
91             sub _test_pair {
92 1   50 1   1924 t::Utility::stash('QUOTE') // skip_all();
93 0           isa_ok( t::Utility::stash('QUOTE')->pair(), 'Finance::Robinhood::Forex::Pair' );
94             }
95              
96             =head1 LEGAL
97              
98             This is a simple wrapper around the API used in the official apps. The author
99             provides no investment, legal, or tax advice and is not responsible for any
100             damages incurred while using this software. This software is not affiliated
101             with Robinhood Financial LLC in any way.
102              
103             For Robinhood's terms and disclosures, please see their website at
104             https://robinhood.com/legal/
105              
106             =head1 LICENSE
107              
108             Copyright (C) Sanko Robinson.
109              
110             This library is free software; you can redistribute it and/or modify it under
111             the terms found in the Artistic License 2. Other copyrights, terms, and
112             conditions may apply to data transmitted through this module. Please refer to
113             the L section.
114              
115             =head1 AUTHOR
116              
117             Sanko Robinson Esanko@cpan.orgE
118              
119             =cut
120              
121             1;