Class: OpenWeatherAPI::Resources::Handlers::QueryHandler

Inherits:
Object
  • Object
show all
Defined in:
lib/open-weather-api/resources/handlers/base.rb

Direct Known Subclasses

BoundingBox, Circle, City, CityID, Geolocation, Zipcode

Instance Method Summary collapse

Constructor Details

#initialize(api_obj, parameters = {}) ⇒ QueryHandler

Returns a new instance of QueryHandler.



6
7
8
9
# File 'lib/open-weather-api/resources/handlers/base.rb', line 6

def initialize(api_obj, parameters = {})
  @api_obj = api_obj
  @parameters = parameters
end

Instance Method Details

#can?Boolean

Returns:

  • (Boolean)


15
16
17
# File 'lib/open-weather-api/resources/handlers/base.rb', line 15

def can?
  value != nil
end

#handleObject



11
12
13
# File 'lib/open-weather-api/resources/handlers/base.rb', line 11

def handle
  build if can?
end