Class: Daneel::Scripts::Help
- Inherits:
-
Daneel::Script
- Object
- Plugin
- Daneel::Script
- Daneel::Scripts::Help
- Defined in:
- lib/daneel/scripts/help.rb
Instance Attribute Summary
Attributes inherited from Plugin
Instance Method Summary collapse
Methods inherited from Daneel::Script
#accepts?, files, inherited, list
Methods inherited from Plugin
#initialize, #logger, requires_env
Constructor Details
This class inherits a constructor from Daneel::Plugin
Instance Method Details
#help ⇒ Object
16 17 18 |
# File 'lib/daneel/scripts/help.rb', line 16 def help {"help" => "show this help summary"} end |
#receive(room, message, user) ⇒ Object
7 8 9 10 11 12 13 14 |
# File 'lib/daneel/scripts/help.rb', line 7 def receive(room, , user) case .command when /help$/ col = helps.keys.map(&:length).max + 2 room.say helps.map{|k,v| "%-#{col}s %s" % [k,v] }.sort.join("\n") .done! end end |