Class: Owa::Requests::Weather

Inherits:
Object
  • Object
show all
Defined in:
lib/owa/requests/weather.rb

Instance Method Summary collapse

Constructor Details

#initialize(options, parser: Parser.new, http_client: HttpClient.new) ⇒ Weather

Returns a new instance of Weather.



4
5
6
7
8
# File 'lib/owa/requests/weather.rb', line 4

def initialize(options, parser: Parser.new, http_client: HttpClient.new)
  @parser = parser
  @http_client = http_client
  @options = options.call
end

Instance Method Details

#callObject



10
11
12
13
# File 'lib/owa/requests/weather.rb', line 10

def call
  response = @http_client.get("weather/", @options)
  @parser.call(response)
end