Sha256: fa2277982cd34ee1f6ef48150fe31734fc69a6624bd33e7342dddeb05bcaba44
Contents?: true
Size: 467 Bytes
Versions: 10
Compression:
Stored size: 467 Bytes
Contents
module Feed2Gram class UpdatesCache def update!(cache, results, options) cache.updated_at = Time.now results.group_by { |result| result.status } .transform_values { |results| results.map { |result| result.post.url } } .each do |status, urls| cache[status] += urls end puts "Writing updated cache to: #{options.cache_path}" if options.verbose File.write(options.cache_path, cache.as_yaml) end end end
Version data entries
10 entries across 10 versions & 1 rubygems