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_003';
22 1     1   7 use Mojo::Base-base, -signatures;
  1         3  
  1         6  
23 1     1   204 use Mojo::URL;
  1         3  
  1         5  
24 1     1   27 use Time::Moment;
  1         2  
  1         24  
25 1     1   5 use Finance::Robinhood::Forex::Pair;
  1         3  
  1         10  
26              
27             sub _test__init {
28 1     1   11503 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 ['ask_price', 'bid_price', 'high_price', 'id',
75             'low_price', 'mark_price', 'open_price', 'symbol',
76             '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   2027 t::Utility::stash('QUOTE') // skip_all();
93 0           isa_ok(t::Utility::stash('QUOTE')->pair(),
94             'Finance::Robinhood::Forex::Pair');
95             }
96              
97             =head1 LEGAL
98              
99             This is a simple wrapper around the API used in the official apps. The author
100             provides no investment, legal, or tax advice and is not responsible for any
101             damages incurred while using this software. This software is not affiliated
102             with Robinhood Financial LLC in any way.
103              
104             For Robinhood's terms and disclosures, please see their website at
105             https://robinhood.com/legal/
106              
107             =head1 LICENSE
108              
109             Copyright (C) Sanko Robinson.
110              
111             This library is free software; you can redistribute it and/or modify it under
112             the terms found in the Artistic License 2. Other copyrights, terms, and
113             conditions may apply to data transmitted through this module. Please refer to
114             the L section.
115              
116             =head1 AUTHOR
117              
118             Sanko Robinson Esanko@cpan.orgE
119              
120             =cut
121              
122             1;