class OpenWeatherAPI::Resources::Current

Public Instance Methods

base_url() click to toggle source
# File lib/open-weather-api/resources/current.rb, line 5
def base_url
  return super + 'group/'    if city_id.multiple?
  return super + 'weather/'  if [city, city_id, geolocation, zipcode].any? { |h| h.can? }
  return super + 'box/city/' if bbox.can?
  return super + 'find/'     if circle.can?
end
bbox() click to toggle source

Other handlers


# File lib/open-weather-api/resources/current.rb, line 35
def bbox
  Handlers::BoundingBox.new @api_obj, @parameters
end
build_params(parameters = {}) click to toggle source
# File lib/open-weather-api/resources/current.rb, line 12
def build_params(parameters = {})
  super [city, city_id, geolocation, zipcode, bbox, circle].each{ |h| break h.handle if h.can? }
end
circle() click to toggle source
# File lib/open-weather-api/resources/current.rb, line 39
def circle
  Handlers::Circle.new @api_obj, @parameters
end
city() click to toggle source

Simple handlers

# File lib/open-weather-api/resources/current.rb, line 17
def city
  Handlers::City.new @api_obj, @parameters
end
city_id() click to toggle source
# File lib/open-weather-api/resources/current.rb, line 21
def city_id
  Handlers::CityID.new @api_obj, @parameters
end
geolocation() click to toggle source
# File lib/open-weather-api/resources/current.rb, line 25
def geolocation
  Handlers::Geolocation.new @api_obj, @parameters
end
zipcode() click to toggle source
# File lib/open-weather-api/resources/current.rb, line 29
def zipcode
  Handlers::Zipcode.new @api_obj, @parameters
end