Method: Pry::CommandSet#create_command
- Defined in:
- lib/pry/command_set.rb
#create_command(match, description = "No description.", options = {}) { ... } ⇒ Object
Defines a new Pry command class.
117 118 119 120 121 122 123 124 125 126 127 128 129 |
# File 'lib/pry/command_set.rb', line 117 def create_command(match, description = "No description.", = {}, &block) if description.is_a?(Hash) = description description = "No description." end = Pry::Command.(match).merge!() @commands[match] = Pry::ClassCommand.subclass( match, description, , helper_module, &block ) @commands[match].class_eval(&block) @commands[match] end |