Sha256: 3c83aa8d500098c7c55ed1c47196db00f5df1965e3adde217175b539748e24a4

Contents?: true

Size: 580 Bytes

Versions: 3

Compression:

Stored size: 580 Bytes

Contents

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

    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
  end
end

require_relative 'api/quote'
require_relative 'api/company'
require_relative 'api/price'
require_relative 'api/news'
require_relative 'api/chart'

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
iex-ruby-client-0.3.2 lib/iex/api.rb
iex-ruby-client-0.3.1 lib/iex/api.rb
iex-ruby-client-0.3.0 lib/iex/api.rb