module OWMO

OMWO = OpenWeatherMap.org client for current and forecasted weather conditions.

Constants

URL

Openweathermap.org URL

VERSION

Gem Version

Public Class Methods

weather(api_key, **params) { |weather| ... } click to toggle source

Yield a weather object for querying weather data

Attributes

Examples

  • Single request: api_key = '' OWMO::weather(api_key).get :current, city_name: “London,UK”

  • Muliple requests: api_key = '' OWMO::weather(api_key) do |weather|

    puts weather.get :current, city_name: "London,UK"
    puts weather.get :forecast5, city_name: "London,UK"
    puts weather.get :forecast16, city_name: "London,UK"
    

    end

# File lib/owmo.rb, line 32
def self.weather(api_key, **params)
  Weather.new(api_key, params) do |weather|
    if block_given?
      yield weather
    else
      weather
    end
  end
end