Sha256: d47b2aa8ec2312a6021380c830afeb185596c5f21e4c8cfad7b76346690813ab

Contents?: true

Size: 504 Bytes

Versions: 10

Compression:

Stored size: 504 Bytes

Contents

module IEX
  module Endpoints
    module News
      def news(symbol, range = nil, options = {})
        get([
          'stock',
          symbol,
          'news',
          range ? 'last' : nil,
          range
        ].compact.join('/'), { token: publishable_token }.merge(options)).map do |data|
          IEX::Resources::News.new(data)
        end
      rescue Faraday::ResourceNotFound => e
        raise IEX::Errors::SymbolNotFoundError.new(symbol, e.response[:body])
      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/news.rb
iex-ruby-client-2.0.0 lib/iex/endpoints/news.rb
iex-ruby-client-1.6.0 lib/iex/endpoints/news.rb
iex-ruby-client-1.5.0 lib/iex/endpoints/news.rb
iex-ruby-client-1.4.1 lib/iex/endpoints/news.rb
iex-ruby-client-1.4.0 lib/iex/endpoints/news.rb
iex-ruby-client-1.3.0 lib/iex/endpoints/news.rb
iex-ruby-client-1.2.0 lib/iex/endpoints/news.rb
iex-ruby-client-1.1.2 lib/iex/endpoints/news.rb
iex-ruby-client-1.1.1 lib/iex/endpoints/news.rb