Sha256: 533e34e25d549157f96afcdc947f2a52fa48f334c0270ce3a7e435987c09b88f
Contents?: true
Size: 586 Bytes
Versions: 14
Compression:
Stored size: 586 Bytes
Contents
# Fetcher module WeatherFetcher class Fetcher def self.fetch(p, max_response_time = 0.8) require 'yaml' classes = ProviderList.providers(max_response_time) result = Array.new classes.each do |c| instance = c.new(p) instance.fetch result += instance.weathers end return result end def self.represent_result(result) puts result.inspect data = result.sort{|r,s| r.time_from <=> s.time_from} data.each do |d| puts "#{d.time_from} #{d.temperature} #{d.wind}" end end end end
Version data entries
14 entries across 14 versions & 1 rubygems