robinhood-api 0.2 → 0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/robinhood.rb +6 -2
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fc1d481ad65b86c46b34bc7b8561902ff23bb06d
|
4
|
+
data.tar.gz: fd11f972293d40c295bc3946cc3d881cf7161691
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f7ae281923e181c25200d91f1ce77dd225ec1214175617b1e67824d3f2954da9d9abf39bf46cd4804d73279cd31440d8ffc65ce9e4f981efaaa0ca8c31e64d08
|
7
|
+
data.tar.gz: e8080fd623a7ddbc221fbfd0119d7b9b403030126653b5b326b137057b1525ec53af5797b50a7dd5a3b6eb21046df21a4d243e87c091b29f530fc104e9b60bb4
|
data/lib/robinhood.rb
CHANGED
@@ -168,8 +168,12 @@ module RobinhoodModule
|
|
168
168
|
raw_response.code == 200
|
169
169
|
end
|
170
170
|
|
171
|
-
def positions(account_number, instrument_id)
|
172
|
-
|
171
|
+
def positions(account_number, instrument_id=nil)
|
172
|
+
url = "https://api.robinhood.com/accounts/#{account_number}/positions"
|
173
|
+
if instrument_id
|
174
|
+
url = "#{url}/#{instrument_id}/"
|
175
|
+
end
|
176
|
+
raw_response = HTTParty.get(url, headers: headers)
|
173
177
|
JSON.parse(raw_response.body)
|
174
178
|
end
|
175
179
|
|
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.
|
4
|
+
version: '0.3'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Thomas Alcala
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-06-02 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: 'Get the most of Robinhood: get accounts, positions, portfolio, buy and
|
14
14
|
sell securities, etc.'
|
@@ -28,12 +28,12 @@ require_paths:
|
|
28
28
|
- lib
|
29
29
|
required_ruby_version: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '0'
|
34
34
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
35
35
|
requirements:
|
36
|
-
- -
|
36
|
+
- - ">="
|
37
37
|
- !ruby/object:Gem::Version
|
38
38
|
version: '0'
|
39
39
|
requirements: []
|