line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Finance::Robinhood::Forex::Portfolio; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
=encoding utf-8 |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
=for stopwords watchlist watchlists untradable urls |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
=head1 NAME |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
Finance::Robinhood::Forex::Portfolio - Represents a Single Forex Portfolio |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
=head1 SYNOPSIS |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
use Finance::Robinhood; |
14
|
|
|
|
|
|
|
my $rh = Finance::Robinhood->new; |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
# TODO |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
=cut |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
our $VERSION = '0.92_001'; |
21
|
1
|
|
|
1
|
|
4786
|
use Mojo::Base-base, -signatures; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
10
|
|
22
|
1
|
|
|
1
|
|
278
|
use Mojo::URL; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
8
|
|
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
sub _test__init { |
25
|
1
|
|
|
1
|
|
8179
|
my $rh = t::Utility::rh_instance(1); |
26
|
0
|
|
|
|
|
0
|
my $act = $rh->forex_portfolios->current; |
27
|
0
|
|
|
|
|
0
|
isa_ok( $act, __PACKAGE__ ); |
28
|
0
|
|
|
|
|
0
|
t::Utility::stash( 'PORTFOLIO', $act ); # Store it for later |
29
|
|
|
|
|
|
|
} |
30
|
1
|
|
|
1
|
|
171
|
use overload '""' => sub ( $s, @ ) { $s->{id} }, fallback => 1; |
|
1
|
|
|
0
|
|
4
|
|
|
1
|
|
|
|
|
11
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
sub _test_stringify { |
33
|
1
|
|
50
|
1
|
|
1950
|
t::Utility::stash('PORTFOLIO') // skip_all(); |
34
|
0
|
|
|
|
|
0
|
like( |
35
|
|
|
|
|
|
|
+t::Utility::stash('PORTFOLIO'), |
36
|
|
|
|
|
|
|
qr'^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$'i |
37
|
|
|
|
|
|
|
); |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
# |
40
|
|
|
|
|
|
|
has _rh => undef => weak => 1; |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
=head1 METHODS |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
=head2 C |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
Returns a UUID. |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
=head2 C |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
Returs a dollar amount. |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
=head2 C |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
Returns a dollar amount if applicable. |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
=head2 C |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
Returns a dollar amount if applicable. |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
=head2 C |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
Returns a UUID. |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
=head2 C |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
Returns a dollar amount. |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
=head2 C |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
Returns a dollar amount. |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
=cut |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
has [ |
75
|
|
|
|
|
|
|
'account_id', 'equity', |
76
|
|
|
|
|
|
|
'extended_hours_equity', 'extended_hours_market_value', |
77
|
|
|
|
|
|
|
'id', 'market_value', |
78
|
|
|
|
|
|
|
'previous_close' |
79
|
|
|
|
|
|
|
]; |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
=head2 C |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
Returns a Time::Moment object. |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
=cut |
86
|
|
|
|
|
|
|
|
87
|
0
|
|
|
0
|
1
|
0
|
sub updated_at ($s) { |
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
88
|
0
|
|
|
|
|
0
|
Time::Moment->from_string( $s->{updated_at} ); |
89
|
|
|
|
|
|
|
} |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
sub _test_updated_at { |
92
|
1
|
|
50
|
1
|
|
1837
|
t::Utility::stash('PORTFOLIO') // skip_all(); |
93
|
0
|
|
|
|
|
|
isa_ok( t::Utility::stash('PORTFOLIO')->updated_at, 'Time::Moment' ); |
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; |