Class: SnowWeather::Conditions

Inherits:
Object
  • Object
show all
Includes:
SnowWeather
Defined in:
lib/SnowWeather/conditions.rb

Constant Summary

Constants included from SnowWeather

VERSION

Instance Attribute Summary

Attributes included from SnowWeather

#api_key

Class Method Summary collapse

Methods included from SnowWeather

api_key, get_api_key

Class Method Details

.getConditions(state, city) ⇒ Object



5
6
7
8
9
10
11
# File 'lib/SnowWeather/conditions.rb', line 5

def self.getConditions(state, city)
  @slash = '/'
  @base_url = 'http://api.wunderground.com/api/' + @@api_key.to_s + '/conditions/q/' + state.to_s + @slash.to_s + city.to_s + '.json'  
  @data = open(@base_url.to_s).read
  @parse_data = JSON.parse(@data)
  return @parse_data
end