Module: IEX::Endpoints::RefData

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

Instance Method Summary collapse

Instance Method Details

#ref_data_isin(isins, options = {}) ⇒ Object



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

def ref_data_isin(isins, options = {})
  response = get('ref-data/isin', { token: publishable_token, isin: Array(isins).join(',') }.merge(options))

  if response.is_a?(Hash) # mapped option was set
    response.transform_values do |rows|
      rows&.map { |row| IEX::Resources::Symbol.new(row) }
    end
  else
    response.map { |row| IEX::Resources::Symbol.new(row) }
  end
end

#ref_data_symbols(options = {}) ⇒ Object



16
17
18
19
# File 'lib/iex/endpoints/ref_data.rb', line 16

def ref_data_symbols(options = {})
  response = get('ref-data/symbols', { token: publishable_token }.merge(options))
  response.map { |row| IEX::Resources::Symbols.new(row) }
end