Sha256: 59c627e77bc2627ae8380d089b929f16a8f3ba01470e58a038f9e1c55fecf5a2
Contents?: true
Size: 879 Bytes
Versions: 4
Compression:
Stored size: 879 Bytes
Contents
# frozen_string_literal: true module EodServices class InstrumentType class <<self def etf?(symbol) call(symbol) == EodModels::InstrumentType::ETF end def stock?(symbol) call(symbol) == EodModels::InstrumentType::STOCK end def option?(symbol) call(symbol) == EodModels::InstrumentType::OPTION end private def call(symbol) fundamentals = EodFacade::Fundamentals.call(symbol) if fundamentals['General']['Type'] == 'ETF' EodModels::InstrumentType::ETF elsif fundamentals['General']['Type'] == 'Common Stock' EodModels::InstrumentType::STOCK elsif EodFacade::Options.call(symbol) EodModels::InstrumentType::OPTION else raise ArgumentError, "Invalid intrument type for #{symbol}" end end end end end
Version data entries
4 entries across 4 versions & 1 rubygems