Module: OW

Extended by:
OW
Included in:
OW
Defined in:
lib/OW/client.rb,
lib/OW/version.rb,
lib/OW/weather.rb

Defined Under Namespace

Classes: Configuration, ForbiddenError, UnknownResponse, UnprocessableError, Weather

Constant Summary collapse

VERSION =
"0.1.0"

Class Attribute Summary collapse

Instance Method Summary collapse

Class Attribute Details

.configurationObject

Returns the value of attribute configuration.



8
9
10
# File 'lib/OW/client.rb', line 8

def configuration
  @configuration
end

Instance Method Details

#configure {|configuration| ... } ⇒ Object

Yields:



21
22
23
24
# File 'lib/OW/client.rb', line 21

def configure
  self.configuration ||= Configuration.new
  yield(configuration)
end

#get_weather(options = {}) ⇒ Object



26
27
28
29
30
31
# File 'lib/OW/client.rb', line 26

def get_weather(options={})
  check_configuration!
  uri = set_params(options)
  response = send_request(uri)
  parse_json(response)
end