lib/cotcube-bardata/eods.rb in cotcube-bardata-0.1.15.4 vs lib/cotcube-bardata/eods.rb in cotcube-bardata-0.1.15.5

- old
+ new

@@ -2,22 +2,22 @@ module Cotcube # Missing top level documentation module Bardata def most_liquid_for(symbol: nil, id: nil, date: last_trade_date, config: init) - id = get_id_set(symbol: symbol, id: id, config: config)[:id] + id = Cotcube::Helpers.get_id_set(symbol: symbol, id: id, config: config)[:id] provide_eods(id: id, dates: date, contracts_only: true).first end # the following method seems to be garbage. It is not used anywhere. It seems it's purpose # was to retrieve a list of quarters that have not been fetched recently (--> :age) def provide_most_liquids_by_eod(symbol: nil, id: nil, # rubocop:disable Metrics/ParameterLists config: init, date: last_trade_date, filter: :volume_part, age: 1.hour) - sym = get_id_set(symbol: symbol, id: id) if symbol || id + sym = Cotcube::Helpers.get_id_set(symbol: symbol, id: id) if symbol || id # noinspection RubyScope eods = provide_eods(id: sym.nil? ? nil : sym[:id], config: config, dates: date, filter: filter) result = [] eods.map do |eod| symbol = eod[0..1] @@ -60,10 +60,10 @@ unless contract.nil? || (contract.is_a?(String) && [3, 5].include?(contract.size)) raise ArgumentError, "Contract '#{contract}' is bogus, should be like 'M21' or 'ESM21'" end symbol = contract[0..1] if contract.to_s.size == 5 - sym = get_id_set(symbol: symbol, id: id, config: config) if symbol || id + sym = Cotcube::Helpers.get_id_set(symbol: symbol, id: id, config: config) if symbol || id # if no id can be clarified from given arguments, return all matching contracts from all available symbols # raise ArgumentError, "Could not guess :id or :symbol from 'contract: #{contract}', please clarify." if id.nil? raise ArgumentError, ':filter must be in [:volume_part, :oi_part]' unless %i[volume_part oi_part].include? filter # noinspection RubyScope