simple_weather 0.0.6 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/simple_weather.rb +14 -14
  2. metadata +1 -1
@@ -2,9 +2,9 @@ require 'rubygems'
2
2
  require 'json'
3
3
  require 'net/http'
4
4
 
5
- '7b1e71b12f5535c0'
5
+ #'7b1e71b12f5535c0'
6
6
  module SimpleWeather
7
- def updateWeather(@conditions, city = 'MD/College Park')
7
+ def updateWeather(conditions, city = 'MD/College Park')
8
8
  base_url = 'http://api.wunderground.com/api/'
9
9
  API_KEY = '7b1e71b12f5535c0'
10
10
  query = '/conditions/q/'
@@ -14,31 +14,31 @@ module SimpleWeather
14
14
  res = Net::HTTP.get_response(URI(url))
15
15
  data = res.body if res.is_a?(Net::HTTPSuccess)
16
16
 
17
- @conditions = JSON.parse(data)
17
+ conditions = JSON.parse(data)
18
18
 
19
- if @conditions.has_key? 'error'
19
+ if conditions.has_key? 'error'
20
20
  raise 'Web service error'
21
21
  end
22
22
  end
23
23
 
24
- def getImageUrl(@conditions)
25
- @conditions['current_observation']['icon_url']
24
+ def getImageUrl(conditions)
25
+ conditions['current_observation']['icon_url']
26
26
  end
27
27
 
28
- def getWeather(@conditions)
29
- @conditions['current_observation']['weather']
28
+ def getWeather(conditions)
29
+ conditions['current_observation']['weather']
30
30
  end
31
31
 
32
- def getTemp_f(@conditions)
33
- @conditions['current_observation']['temp_f']
32
+ def getTemp_f(conditions)
33
+ conditions['current_observation']['temp_f']
34
34
  end
35
35
 
36
- def getTemp_c(@conditions)
37
- @conditions['current_observation']['temp_c']
36
+ def getTemp_c(conditions)
37
+ conditions['current_observation']['temp_c']
38
38
  end
39
39
 
40
- def getFeelsLike(@conditions)
41
- @conditions['current_observation']['fellslike_string']
40
+ def getFeelsLike(conditions)
41
+ conditions['current_observation']['fellslike_string']
42
42
  end
43
43
  end
44
44
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simple_weather
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: