Answer the question
In order to leave comments, you need to log in
How to return the value of a variable from a function?
I am new to ruby. Faced such a problem
def get_old_stats
old_stat = Set.new
last_log = @campaign.job_logs.where("slm_dump_path is NOT NULL").first
return unless last_log
dump_path = last_log.slm_dump_path
raise "slm_dump_path is missing for #{@campaign}" unless dump_path
S3::Archive.new.download(dump_path).each do |id|
old_stat.add(id.first)
end
def get_old_stat
@old_stat
end
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question