Sha256: 9fe08fc97d51314dae8484c38a6d7368e904b937311ecf8833cea58746d4664e

Contents?: true

Size: 583 Bytes

Versions: 1

Compression:

Stored size: 583 Bytes

Contents

require_relative 'ohlc/base'

module IEX
  module Resources
    module OHLC
      def self.get(symbol)
        resource = IEX::Api::OHLC.get(symbol)
        OHLC::Base.new resource
      rescue Faraday::ResourceNotFound => e
        raise IEX::Errors::SymbolNotFoundError.new(symbol, e.response[:body])
      end

      def self.market
        Hash[IEX::Api::OHLC.market.map do |k, v|
          [k, OHLC::Base.new(v)]
        end]
      rescue Faraday::ResourceNotFound => e
        raise IEX::Errors::SymbolNotFoundError.new('market', e.response[:body])
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
iex-ruby-client-0.3.3 lib/iex/resources/ohlc.rb