Module: IEX::Endpoints::Earnings

Included in:
Api::Client
Defined in:
lib/iex/endpoints/earnings.rb

Instance Method Summary collapse

Instance Method Details

#earnings(symbol, options = {}) ⇒ Object


4
5
6
7
8
9
10
# File 'lib/iex/endpoints/earnings.rb', line 4

def earnings(symbol, options = {})
  get("stock/#{symbol}/earnings", options)['earnings'].map do |data|
    IEX::Resources::Earnings.new(data)
  end
rescue Faraday::ResourceNotFound => e
  raise IEX::Errors::SymbolNotFoundError.new(symbol, e.response[:body])
end