Method: Fission::Command#command_name

Defined in:
lib/fission/command.rb

#command_name(klass = self) ⇒ Object

Internal: Helper method to determine the command name of command class. This should only be called against descendants of this class.

#xamples:

Fission::Command::SnapshotList.new.command_name
# => 'snapshot list'

Returns the command name as a String.



63
64
65
66
67
# File 'lib/fission/command.rb', line 63

def command_name(klass=self)
  klass.class.name.split('::')[2].
                   gsub(/([a-z\d])([A-Z])/,'\1_\2').
                   gsub('_', ' ').downcase
end