lib/undergroundweather/features.rb in undergroundweather-0.0.1 vs lib/undergroundweather/features.rb in undergroundweather-0.0.2

- old
+ new

@@ -5,26 +5,27 @@ :conditions => { :class => CurrentConditions }, :forecast => { :class => Forecast }, :astronomy => { :class => Astronomy }, :radar => { :class => Radar }, :satellite => { :class => Satellite }, - :webcams => { :class => Webcams }, - :history => { :class => ''}, - :alerts => { :class => ''}, - :hourly => { :class => ''}, - :hourly7day => { :class => ''}, - :forecast7day => { :class => ''}, - :yesterday => { :class => ''} + :webcams => { :class => Webcams } + #:history => { :class => ''}, + #:alerts => { :class => ''}, + #:hourly => { :class => ''}, + #:hourly7day => { :class => ''}, + #:forecast7day => { :class => ''}, + #:yesterday => { :class => ''} } features.each do |feature, v| define_method(feature) do |zip_code| call = ApiCall.new(@api_key, feature, zip_code) + if call.response && !call.error v[:class].new(call.response) else - #? - "error" + # raise exception here + [] end end end end end \ No newline at end of file