lib/cinch/plugins/weatherman/weather.rb in cinch-weatherman-1.0.4 vs lib/cinch/plugins/weatherman/weather.rb in cinch-weatherman-1.0.5
- old
+ new
@@ -1,22 +1,24 @@
# -*- coding: utf-8 -*-
-module Cinch::Plugins
- class Weatherman
- class Weather
- attr_reader :location
+module Cinch
+ module Plugins
+ class Weatherman
+ # Class to manage information for current conditions
+ class Weather
+ attr_reader :location
- def initialize(location)
- @data = WeatherUnderground::Base.new
- .CurrentObservations(location)
- @location = @data.display_location.first.full
- @temp = @data.temp_f
- @conditions = @data.weather.downcase
- @updated = Time.parse(@data.observation_time).ago.to_words
- end
+ def initialize(location)
+ @data = WeatherUnderground::Base.new.CurrentObservations(location)
+ @location = @data.display_location.first.full
+ @temp = @data.temp_f
+ @conditions = @data.weather.downcase
+ @updated = Time.parse(@data.observation_time).ago.to_words
+ end
- def to_s
- "In #{@location} it is #{@conditions} " +
- "and #{@temp}F (last updated about #{@updated})."
+ def to_s
+ "In #{@location} it is #{@conditions} " \
+ "and #{@temp}F (last updated about #{@updated})."
+ end
end
end
end
end