Module: IEX::Endpoints::Dividends

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

Instance Method Summary collapse

Instance Method Details

#dividends(symbol, range = nil, options = {}) ⇒ Object


4
5
6
7
8
9
10
11
12
13
14
15
# File 'lib/iex/endpoints/dividends.rb', line 4

def dividends(symbol, range = nil, options = {})
  get([
    'stock',
    symbol,
    'dividends',
    range
  ].compact.join('/'), options).map do |data|
    IEX::Resources::Dividends.new(data)
  end
rescue Faraday::ResourceNotFound => e
  raise IEX::Errors::SymbolNotFoundError.new(symbol, e.response[:body])
end