Module: OpenWeatherAPI

Defined in:
lib/open-weather-api/api.rb,
lib/open-weather-api/config.rb,
lib/open-weather-api/version.rb,
lib/open-weather-api/resources/raw.rb,
lib/open-weather-api/resources/base.rb,
lib/open-weather-api/resources/current.rb,
lib/open-weather-api/resources/handlers/base.rb,
lib/open-weather-api/resources/forecast_daily.rb,
lib/open-weather-api/resources/forecast_hourly.rb,
lib/open-weather-api/resources/handlers/current.rb

Defined Under Namespace

Modules: Resources Classes: API

Constant Summary collapse

VERSION =
'0.0.7'

Class Method Summary collapse

Class Method Details

.configure(&block) ⇒ Object

Raises:

  • (ArgumentError)


2
3
4
5
6
7
8
# File 'lib/open-weather-api/config.rb', line 2

def self.configure(&block)
  raise ArgumentError, 'No block was given.' unless block

  api = Rails.configuration.open_weather_api = OpenWeatherAPI::API.new
  block.call(api)
  api
end