Sha256: 016ff47a3d807c3a677c6e4faada7461b9837dd362f05ffa64082c9d35728a09
Contents?: true
Size: 470 Bytes
Versions: 3
Compression:
Stored size: 470 Bytes
Contents
module Ellen module Handlers class Help < Base on /help\z/i, name: "help", description: "Show this help message" def help(message) 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 end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
ellen-0.1.0 | lib/ellen/handlers/help.rb |
ellen-0.0.9 | lib/ellen/handlers/help.rb |
ellen-0.0.8 | lib/ellen/handlers/help.rb |