Class: Lita::Handlers::Whats
- Inherits:
-
Handler
- Object
- Handler
- Lita::Handlers::Whats
- Defined in:
- lib/lita/handlers/whats.rb
Instance Method Summary collapse
Instance Method Details
#whats(response) ⇒ Object
9 10 11 12 13 14 15 16 17 18 |
# File 'lib/lita/handlers/whats.rb', line 9 def whats(response) hostname = response.matches[0][0] whats_cmd = "whats -q -j #{hostname}" output = `#{whats_cmd}` = "" JSON.parse(output).each_pair do |k,v| = + "*#{k}*: #{v}\n" end response.reply end |