Method: CommandMapper::Command.command

Defined in:
lib/command_mapper/command.rb

.command(new_command_name) {|self| ... } ⇒ Object

Examples:

command 'grep'
# ...
command 'grep' do
  option "--regexp", equals: true, value: true
  # ...
end

Parameters:

  • new_command_name (#to_s)

Yields:

  • (self)


317
318
319
320
# File 'lib/command_mapper/command.rb', line 317

def self.command(new_command_name,&block)
  @command_name = new_command_name.to_s.freeze
  yield self if block_given?
end