Class: Cinch::Plugins::Weatherman

Inherits:
Object
  • Object
show all
Includes:
Cinch::Plugin
Defined in:
lib/cinch/plugins/weatherman.rb,
lib/cinch/plugins/weatherman/version.rb,
lib/cinch/plugins/weatherman/weather.rb,
lib/cinch/plugins/weatherman/forecast.rb

Overview

Versioning Info

Defined Under Namespace

Classes: Forecast, Weather

Constant Summary collapse

VERSION =
'1.0.5'

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ Weatherman

Returns a new instance of Weatherman.



17
18
19
20
21
22
23
24
25
# File 'lib/cinch/plugins/weatherman.rb', line 17

def initialize(*args)
  super
  @append =
    if config.key?(:append_forecast)
      config[:append_forecast]
    else
      false
    end
end

Instance Method Details

#forecast(m, query) ⇒ Object



34
35
36
# File 'lib/cinch/plugins/weatherman.rb', line 34

def forecast(m, query)
  m.reply get_forecast(query)
end

#weather(m, query) ⇒ Object



30
31
32
# File 'lib/cinch/plugins/weatherman.rb', line 30

def weather(m, query)
  m.reply get_weather(query)
end