Module: CommandKit::Description

Extended by:
ModuleMethods
Includes:
Help
Included in:
Command
Defined in:
lib/command_kit/description.rb

Overview

Allows adding a description to a command's class.

Examples

include CommandKit::Description

description "Does things and stuff"

Defined Under Namespace

Modules: ClassMethods, ModuleMethods

Instance Method Summary collapse

Methods included from ModuleMethods

included

Methods included from Help::ModuleMethods

#included

Instance Method Details

#descriptionObject



76
77
78
# File 'lib/command_kit/description.rb', line 76

def description
  self.class.description
end

#helpObject

Calls the superclass'es #help method, if it's defined, then calls #help_description.



98
99
100
101
102
# File 'lib/command_kit/description.rb', line 98

def help
  super

  help_description
end

#help_descriptionObject

Prints the description, if set.



85
86
87
88
89
90
# File 'lib/command_kit/description.rb', line 85

def help_description
  if (description = self.description)
    puts
    puts description
  end
end