Class: OpenWeatherAPI::Resources::QueryHandler

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

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of QueryHandler.



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

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

Instance Method Details

#can?Boolean

Returns:

  • (Boolean)


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

def can?
  value != nil
end

#handleObject



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

def handle
  build if can?
end