Class: Weather
- Inherits:
-
Object
- Object
- Weather
- Includes:
- Cinch::Plugin
- Defined in:
- lib/rateless_bot/plugins/weather.rb
Instance Method Summary collapse
- #execute(m) ⇒ Object
- #help ⇒ Object
-
#initialize(*args) ⇒ Weather
constructor
A new instance of Weather.
Constructor Details
#initialize(*args) ⇒ Weather
Returns a new instance of Weather.
12 13 14 15 |
# File 'lib/rateless_bot/plugins/weather.rb', line 12 def initialize(*args) super = { units: 'metric', APPID: config[:api_key] } end |
Instance Method Details
#execute(m) ⇒ Object
19 20 21 22 23 24 25 |
# File 'lib/rateless_bot/plugins/weather.rb', line 19 def execute(m) city = m..split('!weather ')[1] current_weather = OpenWeather::Current.city(city, ) m.reply make_current_weather_str(current_weather) end |
#help ⇒ Object
6 7 8 |
# File 'lib/rateless_bot/plugins/weather.rb', line 6 def help '!weather CITY/ZIP - gets the current temperature for a given city/zip' end |