class EodServices::InstrumentType

Public Class Methods

bond?(symbol) click to toggle source
# File lib/eod_services/instrument_type.rb, line 26
def bond?(symbol)
  !!EodFacade::BondFundamentals.call(symbol)
rescue ArgumentError
  false
end
etf?(symbol) click to toggle source
# File lib/eod_services/instrument_type.rb, line 6
def etf?(symbol)
  fundamentals = EodFacade::Fundamentals.call(symbol)
  !!(fundamentals.dig('General', 'Type') == 'ETF')
rescue ArgumentError
  false
end
option?(symbol) click to toggle source
# File lib/eod_services/instrument_type.rb, line 20
def option?(symbol)
  !!EodFacade::Options.call(symbol)
rescue ArgumentError
  false
end
stock?(symbol) click to toggle source
# File lib/eod_services/instrument_type.rb, line 13
def stock?(symbol)
  fundamentals = EodFacade::Fundamentals.call(symbol)
  !!(fundamentals.dig('General', 'Type') == 'Common Stock')
rescue ArgumentError
  false
end