📜  gem 'iex-ruby-client' 如何设置 - Ruby 代码示例

📅  最后修改于: 2022-03-11 15:04:47.660000             🧑  作者: Mango

代码示例1
# Use initializer by creating a config file(i.e: iex_client.rb) under the directory /config/initializers and add:

Configure IEX::Api.configure do |config|
  config.publishable_token = 'token' # defaults to 
  ENV['IEX_API_PUBLISHABLE_TOKEN']
  config.endpoint = 'https://sandbox.iexapis.com/v1' # defaults to 
  'https://cloud.iexapis.com/v1'
end 

# You probably need to replace token with a correct one. You also need to make sure to require the library wherever you wanna use it.