class Object

Constants

MONTHS

Public Instance Methods

client_proxy(iq_client, options, o) click to toggle source
# File lib/tools/history.rb, line 18
def client_proxy(iq_client, options, o)
  iq_client.send(options[:method], options, o)
end
get_valid_codes(today, months) click to toggle source
# File lib/tools/history.rb, line 22
def get_valid_codes(today, months)
  current_month = today.month
  valid_months = months.map{|m| MONTHS.index(m) + 1}.select{|m| m >= current_month}.map{|m| "#{MONTHS[m-1]}#{today.year-2000}"}.slice(0,2)
  valid_months = valid_months + months.slice(0, 2 - valid_months.length).map{|m| m + "#{today.year-2000+1}"} if valid_months.length < 2    
  valid_months
end