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

Version Path
weather_fetcher-0.1.2 lib/weather_fetcher/fetcher.rb
weather_fetcher-0.1.1 lib/weather_fetcher/fetcher.rb
weather_fetcher-0.1.0 lib/weather_fetcher/fetcher.rb
weather_fetcher-0.0.16 lib/weather_fetcher/fetcher.rb
weather_fetcher-0.0.15 lib/weather_fetcher/fetcher.rb
weather_fetcher-0.0.14 lib/weather_fetcher/fetcher.rb
weather_fetcher-0.0.13 lib/weather_fetcher/fetcher.rb
weather_fetcher-0.0.12 lib/weather_fetcher/fetcher.rb
weather_fetcher-0.0.11 lib/weather_fetcher/fetcher.rb
weather_fetcher-0.0.10 lib/weather_fetcher/fetcher.rb
weather_fetcher-0.0.9 lib/weather_fetcher/fetcher.rb
weather_fetcher-0.0.8 lib/weather_fetcher/fetcher.rb
weather_fetcher-0.0.7 lib/weather_fetcher/fetcher.rb
weather_fetcher-0.0.6 lib/weather_fetcher/fetcher.rb