robinhood-api 0.3 → 0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/robinhood.rb +7 -2
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fc1d481ad65b86c46b34bc7b8561902ff23bb06d
4
- data.tar.gz: fd11f972293d40c295bc3946cc3d881cf7161691
3
+ metadata.gz: 3d0fbdabc887db5596ff5ce6a66e3f6aaddbb8a8
4
+ data.tar.gz: 014f791c53faf20d4fa38c2d87d7c146eab52d42
5
5
  SHA512:
6
- metadata.gz: f7ae281923e181c25200d91f1ce77dd225ec1214175617b1e67824d3f2954da9d9abf39bf46cd4804d73279cd31440d8ffc65ce9e4f981efaaa0ca8c31e64d08
7
- data.tar.gz: e8080fd623a7ddbc221fbfd0119d7b9b403030126653b5b326b137057b1525ec53af5797b50a7dd5a3b6eb21046df21a4d243e87c091b29f530fc104e9b60bb4
6
+ metadata.gz: 659bc03021db7b109943d7e5609d1e2c2532de5467ff0acc8326afb290a6d9e9598d579926036772b7ba2b15664e20238a6f4f324ede1ebfce088beed640d2c1
7
+ data.tar.gz: 98859191ed7a72292196d8a5cd95bcd95c45b0101cd4cb00ecc0112734ac29167154217b1fd4380225765e74e7d736c69c37ad9423476b8e4a7ff539b1393b0a
@@ -64,7 +64,12 @@ module RobinhoodModule
64
64
  end
65
65
 
66
66
  def instruments(symbol)
67
- raw_response = HTTParty.get(endpoints[:instruments], query: {'query' => symbol.upcase}, headers: headers)
67
+ if symbol.include?('-')
68
+ raw_response = HTTParty.get("#{endpoints[:instruments]}#{symbol}/", headers: headers)
69
+ else
70
+ raw_response = HTTParty.get(endpoints[:instruments], query: {'query' => symbol.upcase}, headers: headers)
71
+ end
72
+
68
73
  JSON.parse(raw_response.body)
69
74
  end
70
75
 
@@ -168,7 +173,7 @@ module RobinhoodModule
168
173
  raw_response.code == 200
169
174
  end
170
175
 
171
- def positions(account_number, instrument_id=nil)
176
+ def positions(account_number, instrument_id = nil)
172
177
  url = "https://api.robinhood.com/accounts/#{account_number}/positions"
173
178
  if instrument_id
174
179
  url = "#{url}/#{instrument_id}/"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: robinhood-api
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.3'
4
+ version: '0.4'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thomas Alcala