Module: IEX::Endpoints::Sectors

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

Instance Method Summary collapse

Instance Method Details

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



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

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