robinhood-api 0.6.1 → 0.6.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/robinhood/api.rb +7 -27
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 45527da658148faf70dcd8b6c1897445bfee2337b7b46b22203efa6d39c585e7
|
4
|
+
data.tar.gz: e2e5a197be3bfbc572bb9c3db0e272641c0c10def4b7bc96d64bb103b01cba72
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b29b1231243e15aef3a6623a7e5c330541f4cd48f52425657ae27dab4cd004741669150b995270d43a7584386d2aa14f97e5d1d2c8f54572916ec620c0e87ed6
|
7
|
+
data.tar.gz: f4ce6159d225935cfb3fc88d1b6b0b31033b2ae3d765362ba2eaa6fc9439299e064ecaf355d6a25bd1c18f546edbedf468895b984b98144521b3bccc86ccc1c0
|
data/lib/robinhood/api.rb
CHANGED
@@ -25,6 +25,7 @@ module Robinhood
|
|
25
25
|
require 'httparty'
|
26
26
|
require 'json'
|
27
27
|
|
28
|
+
require_relative './api/accounts'
|
28
29
|
require_relative './api/orders'
|
29
30
|
|
30
31
|
include HTTParty
|
@@ -50,26 +51,6 @@ module Robinhood
|
|
50
51
|
response
|
51
52
|
end
|
52
53
|
|
53
|
-
def investment_profile
|
54
|
-
raw_response = HTTParty.get(
|
55
|
-
endpoints[:investment_profile], headers: headers
|
56
|
-
)
|
57
|
-
JSON.parse(raw_response.body)
|
58
|
-
end
|
59
|
-
|
60
|
-
def accounts
|
61
|
-
raw_response = HTTParty.get(endpoints[:accounts], headers: headers)
|
62
|
-
JSON.parse(raw_response.body)
|
63
|
-
end
|
64
|
-
|
65
|
-
def portfolio(account_number)
|
66
|
-
raw_response = HTTParty.get(
|
67
|
-
"https://api.robinhood.com/accounts/#{account_number}/portfolio/",
|
68
|
-
headers: headers
|
69
|
-
)
|
70
|
-
JSON.parse(raw_response.body)
|
71
|
-
end
|
72
|
-
|
73
54
|
def instruments(symbol)
|
74
55
|
if symbol.include?('-')
|
75
56
|
raw_response = HTTParty.get(
|
@@ -127,12 +108,6 @@ module Robinhood
|
|
127
108
|
}
|
128
109
|
end
|
129
110
|
|
130
|
-
def methodlist
|
131
|
-
%i[investment_profile accounts ach_iav_auth ach_relationships
|
132
|
-
ach_transfers applications dividends edocuments margin_upgrade
|
133
|
-
notifications orders password_reset document_requests user watchlists]
|
134
|
-
end
|
135
|
-
|
136
111
|
def headers
|
137
112
|
@headers ||= {
|
138
113
|
'Accept' => 'application/json'
|
@@ -150,7 +125,6 @@ module Robinhood
|
|
150
125
|
true
|
151
126
|
end
|
152
127
|
end
|
153
|
-
|
154
128
|
# before(*instance_methods) { puts 'start' }
|
155
129
|
end
|
156
130
|
|
@@ -158,6 +132,12 @@ module Robinhood
|
|
158
132
|
class Api
|
159
133
|
include ApiModule
|
160
134
|
|
135
|
+
def self.methodlist
|
136
|
+
%i[investment_profile accounts ach_iav_auth ach_relationships
|
137
|
+
ach_transfers applications dividends edocuments margin_upgrade
|
138
|
+
notifications orders password_reset document_requests user watchlists]
|
139
|
+
end
|
140
|
+
|
161
141
|
def self.flatten(var)
|
162
142
|
new_var = {}
|
163
143
|
var.each do |k, v|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: robinhood-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Thomas Alcala
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-04-
|
11
|
+
date: 2018-04-27 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: 'Get the most of Robinhood: accounts, positions, portfolio, buy and sell
|
14
14
|
securities, etc.'
|