Module: Console::DefaultCommands
- Defined in:
- lib/console/default_commands.rb
Class Method Summary collapse
Class Method Details
.included(cls) ⇒ Object
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/console/default_commands.rb', line 2 def self.included(cls) cls.instance_eval do define_cmd(:help, "show commands") do self.class.commands.each do |key, val| puts " #{key}: #{val[:desc]}" end end define_cmd(:exit, "quit client") do puts 'good bye!' exit end end end |