schwab-api-ruby 2.0.1 → 2.1.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '09b5c18abd2a4f667636bf4a533c69f712abf93303b907d6a259b7b4cfad43fd'
4
- data.tar.gz: 79ce6904f54e11d27d91d6efabafdcb4c0b82c5a70a05150240699a5225083da
3
+ metadata.gz: a2aa249e30dc900c19f003e9085db5fe33907a69156e8eef47cd669bd09364d7
4
+ data.tar.gz: 298dc7d7330942e8c9f89189e3552ca165038616f8a825873cc0ce227f37fff4
5
5
  SHA512:
6
- metadata.gz: ebaeec72abdbd2c81960388dc48b8fcf3d41dda11f1a872b7be27e9311f6b2d01eaa175426f39f3ca3425e8b078dd6589a4f70de5b9e7ba7543d3643ba446e09
7
- data.tar.gz: e4cd9842d84adc0c8a048f252bff2917a9584a1beeb26cabca2f7f9dd57a5a98a93148c57b8a8d6e251b51fc80a3c009558b6d311fe26e872cd667c236eccd88
6
+ metadata.gz: 8807115e742d49e4eadbbb87ace49fcae2875643ca029b62788c72189276d0e5477cdef567c0a83ab00fabb8512a5605573ca5f56d0051805daeda06ae5bd55f
7
+ data.tar.gz: d87fd1a1704c794cf60e7eae06026f7fa79098fb17a36af3b6fd0af0d14a0ede142b2640d019203b9d17e9d21906f4468c6675f6509e23a5349ece994608eef9
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ Version 2.1.0
2
+ - Enable Instrument endpoint with "projection" param so you can query for fundamentals or other data about the ticker
3
+
1
4
  Version 2.0.0
2
5
  - This is version 2.0.0 becuase it's a continuation of the TDAmeritradeAPI gem.
3
6
 
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
- # require 'schwab/operations/get_instrument_fundamentals'
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
- # def get_instrument_fundamentals(symbol)
25
- # Operations::GetInstrumentFundamentals.new(self).call(symbol)
26
- # end
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
@@ -1,3 +1,3 @@
1
1
  module Schwab
2
- VERSION = '2.0.1'
2
+ VERSION = '2.1.0'
3
3
  end
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.0.1
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-06-30 00:00:00.000000000 Z
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/get_instrument_fundamentals.rb
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