Sha256: 3094e8e712d8a9f65ab9e64a7523d0b70f834ee37b074aa1ad5dea58b671e0a1

Contents?: true

Size: 535 Bytes

Versions: 10

Compression:

Stored size: 535 Bytes

Contents

module IEX
  module Endpoints
    module Ohlc
      def ohlc(symbol, options = {})
        IEX::Resources::OHLC.new(get("stock/#{symbol}/ohlc", { token: publishable_token }.merge(options)))
      rescue Faraday::ResourceNotFound => e
        raise IEX::Errors::SymbolNotFoundError.new(symbol, e.response[:body])
      end

      def market(options = {})
        Hash[get('stock/market/ohlc', { token: publishable_token }.merge(options)).map do |k, v|
          [k, IEX::Resources::OHLC.new(v)]
        end]
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
iex-ruby-client-2.1.0 lib/iex/endpoints/ohlc.rb
iex-ruby-client-2.0.0 lib/iex/endpoints/ohlc.rb
iex-ruby-client-1.6.0 lib/iex/endpoints/ohlc.rb
iex-ruby-client-1.5.0 lib/iex/endpoints/ohlc.rb
iex-ruby-client-1.4.1 lib/iex/endpoints/ohlc.rb
iex-ruby-client-1.4.0 lib/iex/endpoints/ohlc.rb
iex-ruby-client-1.3.0 lib/iex/endpoints/ohlc.rb
iex-ruby-client-1.2.0 lib/iex/endpoints/ohlc.rb
iex-ruby-client-1.1.2 lib/iex/endpoints/ohlc.rb
iex-ruby-client-1.1.1 lib/iex/endpoints/ohlc.rb