Class: Ellen::Handlers::Help
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
Methods inherited from Base
actions, #call, inherited, #initialize, on
Constructor Details
This class inherits a constructor from Ellen::Handlers::Base
Instance Method Details
#help(message) ⇒ Object
6 7 8 9 10 11 12 13 |
# File 'lib/ellen/handlers/help.rb', line 6 def help() lines = Ellen.handlers.map(&:actions).flatten.sort_by(&:all?).map do |action| prefix = "@#{robot.name} " unless action.all? line = "%-30s - #{action.description}" % "#{prefix}#{action.pattern.inspect}" line end robot.say lines.join("\n") end |