schwab-api-ruby 2.0.0 → 2.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/lib/schwab/authentication.rb +1 -1
- data/lib/schwab/client.rb +4 -4
- data/lib/schwab/operations/get_instrument.rb +23 -0
- data/lib/schwab/version.rb +1 -1
- data/spec/tdameritrade/operations/error_spec.rb +2 -2
- metadata +3 -3
- data/lib/schwab/operations/get_instrument_fundamentals.rb +0 -23
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a2aa249e30dc900c19f003e9085db5fe33907a69156e8eef47cd669bd09364d7
|
4
|
+
data.tar.gz: 298dc7d7330942e8c9f89189e3552ca165038616f8a825873cc0ce227f37fff4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8807115e742d49e4eadbbb87ace49fcae2875643ca029b62788c72189276d0e5477cdef567c0a83ab00fabb8512a5605573ca5f56d0051805daeda06ae5bd55f
|
7
|
+
data.tar.gz: d87fd1a1704c794cf60e7eae06026f7fa79098fb17a36af3b6fd0af0d14a0ede142b2640d019203b9d17e9d21906f4468c6675f6509e23a5349ece994608eef9
|
data/CHANGELOG.md
CHANGED
data/lib/schwab/client.rb
CHANGED
@@ -2,7 +2,7 @@ require 'schwab/authentication'
|
|
2
2
|
require 'schwab/client'
|
3
3
|
require 'schwab/error'
|
4
4
|
require 'schwab/version'
|
5
|
-
|
5
|
+
require 'schwab/operations/get_instrument'
|
6
6
|
require 'schwab/operations/get_price_history'
|
7
7
|
require 'schwab/operations/get_quotes'
|
8
8
|
|
@@ -21,9 +21,9 @@ module Schwab
|
|
21
21
|
@redirect_uri = args[:redirect_uri] || raise_error('redirect_uri is required!')
|
22
22
|
end
|
23
23
|
|
24
|
-
|
25
|
-
|
26
|
-
|
24
|
+
def get_instrument(symbol, projection)
|
25
|
+
Operations::GetInstrument.new(self).call(symbol, projection:)
|
26
|
+
end
|
27
27
|
|
28
28
|
def get_price_history(symbol, **options)
|
29
29
|
Operations::GetPriceHistory.new(self).call(symbol, **options)
|
@@ -0,0 +1,23 @@
|
|
1
|
+
require 'schwab/operations/base_operation'
|
2
|
+
|
3
|
+
module Schwab; module Operations
|
4
|
+
class GetInstrument < BaseOperation
|
5
|
+
|
6
|
+
def call(symbols, projection:)
|
7
|
+
symbol = symbols.is_a?(Array) ? symbols.join(',') : symbols
|
8
|
+
|
9
|
+
params = {
|
10
|
+
symbol: symbol,
|
11
|
+
projection:
|
12
|
+
}
|
13
|
+
|
14
|
+
response = perform_api_get_request(
|
15
|
+
url: 'https://api.schwabapi.com/marketdata/v1/instruments',
|
16
|
+
query: params,
|
17
|
+
)
|
18
|
+
|
19
|
+
response
|
20
|
+
end
|
21
|
+
|
22
|
+
end
|
23
|
+
end; end
|
data/lib/schwab/version.rb
CHANGED
@@ -35,7 +35,7 @@ describe Schwab::Error do
|
|
35
35
|
end
|
36
36
|
|
37
37
|
it 'raises a RateLimitError' do
|
38
|
-
expect { subject }.to raise_error(Schwab::
|
38
|
+
expect { subject }.to raise_error(Schwab::RateLimitError)
|
39
39
|
end
|
40
40
|
end
|
41
41
|
|
@@ -68,7 +68,7 @@ describe Schwab::Error do
|
|
68
68
|
end
|
69
69
|
|
70
70
|
it 'raises a NotAuthorizedError' do
|
71
|
-
expect { subject }.to raise_error(Schwab::
|
71
|
+
expect { subject }.to raise_error(Schwab::NotAuthorizedError)
|
72
72
|
end
|
73
73
|
end
|
74
74
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: schwab-api-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Winston Kotzan
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-07-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -114,7 +114,7 @@ files:
|
|
114
114
|
- lib/schwab/client.rb
|
115
115
|
- lib/schwab/error.rb
|
116
116
|
- lib/schwab/operations/base_operation.rb
|
117
|
-
- lib/schwab/operations/
|
117
|
+
- lib/schwab/operations/get_instrument.rb
|
118
118
|
- lib/schwab/operations/get_price_history.rb
|
119
119
|
- lib/schwab/operations/get_quotes.rb
|
120
120
|
- lib/schwab/operations/support/build_watchlist_items.rb
|
@@ -1,23 +0,0 @@
|
|
1
|
-
# require 'schwab/operations/base_operation'
|
2
|
-
#
|
3
|
-
# module Schwab
|
4
|
-
# ; module Operations
|
5
|
-
# class GetInstrumentFundamentals < BaseOperation
|
6
|
-
#
|
7
|
-
# def call(symbol)
|
8
|
-
# params = {
|
9
|
-
# apikey: client.client_id,
|
10
|
-
# symbol: symbol,
|
11
|
-
# projection: 'fundamental'
|
12
|
-
# }
|
13
|
-
#
|
14
|
-
# response = perform_api_get_request(
|
15
|
-
# url: 'https://api.tdameritrade.com/v1/instruments',
|
16
|
-
# query: params,
|
17
|
-
# )
|
18
|
-
#
|
19
|
-
# parse_api_response(response)
|
20
|
-
# end
|
21
|
-
#
|
22
|
-
# end
|
23
|
-
# end; end
|