Module: IEX::Endpoints::News
- Included in:
- Api::Client
- Defined in:
- lib/iex/endpoints/news.rb
Instance Method Summary collapse
Instance Method Details
#news(symbol, range = nil, options = {}) ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/iex/endpoints/news.rb', line 4 def news(symbol, range = nil, = {}) get([ 'stock', symbol, 'news', range ? 'last' : nil, range ].compact.join('/'), { token: publishable_token }.merge()).map do |data| IEX::Resources::News.new(data) end rescue Faraday::ResourceNotFound => e raise IEX::Errors::SymbolNotFoundError.new(symbol, e.response[:body]) end |