class TDAmeritrade::Client
Public Class Methods
new(**args)
click to toggle source
# File lib/tdameritrade/client.rb, line 18 def initialize(**args) @access_token = args[:access_token] @refresh_token = args[:refresh_token] @access_token_expires_at = args[:access_token_expires_at] @refresh_token_expires_at = args[:refresh_token_expires_at] @client_id = args[:client_id] || Error.gem_error('client_id is required!') @redirect_uri = args[:redirect_uri] || Error.gem_error('redirect_uri is required!') end
Public Instance Methods
create_watchlist(account_id, watchlist_name, symbols)
click to toggle source
# File lib/tdameritrade/client.rb, line 39 def create_watchlist(account_id, watchlist_name, symbols) Operations::CreateWatchlist.new(self).call(account_id, watchlist_name, symbols) end
get_instrument_fundamentals(symbol)
click to toggle source
# File lib/tdameritrade/client.rb, line 27 def get_instrument_fundamentals(symbol) Operations::GetInstrumentFundamentals.new(self).call(symbol) end
get_price_history(symbol, **options)
click to toggle source
# File lib/tdameritrade/client.rb, line 31 def get_price_history(symbol, **options) Operations::GetPriceHistory.new(self).call(symbol, options) end
get_quotes(symbols)
click to toggle source
# File lib/tdameritrade/client.rb, line 35 def get_quotes(symbols) Operations::GetQuotes.new(self).call(symbols: symbols) end
get_watchlists(account_id)
click to toggle source
# File lib/tdameritrade/client.rb, line 43 def get_watchlists(account_id) Operations::GetWatchlists.new(self).call(account_id: account_id) end
replace_watchlist(account_id, watchlist_id, watchlist_name, symbols_to_add=[])
click to toggle source
# File lib/tdameritrade/client.rb, line 47 def replace_watchlist(account_id, watchlist_id, watchlist_name, symbols_to_add=[]) Operations::ReplaceWatchlist.new(self).call(account_id, watchlist_id, watchlist_name, symbols_to_add) end
update_watchlist(account_id, watchlist_id, watchlist_name, symbols_to_add=[])
click to toggle source
# File lib/tdameritrade/client.rb, line 51 def update_watchlist(account_id, watchlist_id, watchlist_name, symbols_to_add=[]) Operations::UpdateWatchlist.new(self).call(account_id, watchlist_id, watchlist_name, symbols_to_add) end