module CommandKit::CommandName
Defines or derives a command class'es command-name.
## Examples
### Implicit
class MyCmd include CommandKit::CommandName end MyCmd.command_name # => "my_cmd"
### Explicit
class MyCmd include CommandKit::CommandName commnad_name 'foo-cmd' end MyCmd.command_name # => "foo-cmd"
Attributes
command_name[R]
The commands name.
@return [String]
@api public
Public Class Methods
new(command_name: self.class.command_name, **kwargs)
click to toggle source
Initializes command_name.
@param [String] command_name
Overrides the command name. Defaults to {ClassMethods#command_name self.class.command_name}.
@api public
Calls superclass method
# File lib/command_kit/command_name.rb, line 98 def initialize(command_name: self.class.command_name, **kwargs) @command_name = command_name super(**kwargs) end