Module: IEX::Api

Defined in:
lib/iex/api.rb,
lib/iex/api/logo.rb,
lib/iex/api/news.rb,
lib/iex/api/ohlc.rb,
lib/iex/api/chart.rb,
lib/iex/api/price.rb,
lib/iex/api/quote.rb,
lib/iex/api/company.rb,
lib/iex/api/earnings.rb,
lib/iex/api/dividends.rb,
lib/iex/api/key_stats.rb

Defined Under Namespace

Modules: Chart, Company, Dividends, Earnings, KeyStats, Logo, News, OHLC, Price, Quote

Constant Summary collapse

ROOT_URI =
'https://api.iextrading.com/1.0/stock'.freeze

Class Method Summary collapse

Class Method Details

.default_connection(path) ⇒ Object


5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/iex/api.rb', line 5

def self.default_connection(path)
  Faraday.new(
    url: "#{ROOT_URI}/#{path}",
    request: {
      params_encoder: Faraday::FlatParamsEncoder
    }
  ) do |c|
    c.use ::FaradayMiddleware::ParseJson
    c.use Faraday::Response::RaiseError
    c.use Faraday::Adapter::NetHttp
  end
end