Class: SchwabRb::AsyncClient
- Inherits:
-
BaseClient
- Object
- BaseClient
- SchwabRb::AsyncClient
- Defined in:
- lib/schwab_rb/clients/async_client.rb
Instance Attribute Summary
Attributes inherited from BaseClient
#api_key, #app_secret, #enforce_enums, #session, #token_manager
Instance Method Summary collapse
- #close_async_session ⇒ Object
-
#initialize(api_key, app_secret, session, token_manager:, enforce_enums: true) ⇒ AsyncClient
constructor
A new instance of AsyncClient.
Methods inherited from BaseClient
#available_account_names, #cancel_order, #get_account, #get_account_numbers, #get_account_orders, #get_accounts, #get_all_linked_account_orders, #get_instrument_by_cusip, #get_instruments, #get_market_hours, #get_movers, #get_option_chain, #get_option_expiration_chain, #get_order, #get_price_history, #get_price_history_every_day, #get_price_history_every_fifteen_minutes, #get_price_history_every_five_minutes, #get_price_history_every_minute, #get_price_history_every_ten_minutes, #get_price_history_every_thirty_minutes, #get_price_history_every_week, #get_quote, #get_quotes, #get_transaction, #get_transactions, #get_user_preferences, #place_order, #preview_order, #refresh!, #replace_order, #set_timeout, #timeout, #token_age
Methods included from EnumEnforcer
#convert_enum, #convert_enum_iterable, #enforce_enums=, #enforce_enums?, #get_valid_enum_values, #set_enforce_enums, #type_error
Constructor Details
#initialize(api_key, app_secret, session, token_manager:, enforce_enums: true) ⇒ AsyncClient
Returns a new instance of AsyncClient.
14 15 16 17 18 |
# File 'lib/schwab_rb/clients/async_client.rb', line 14 def initialize(api_key, app_secret, session, token_manager:, enforce_enums: true) super @endpoint = Async::HTTP::Endpoint.parse(SchwabRb::Constants::SCHWAB_BASE_URL) @client = Async::HTTP::Client.new(@endpoint) end |
Instance Method Details
#close_async_session ⇒ Object
20 21 22 |
# File 'lib/schwab_rb/clients/async_client.rb', line 20 def close_async_session @client.close end |