Module: CommandKit::Description::ClassMethods

Defined in:
lib/command_kit/description.rb

Overview

Defines class-level methods.

Instance Method Summary collapse

Instance Method Details

#description(new_description = nil) ⇒ String?

Gets or sets the description string.

Examples:

description "Does things and stuff"

Parameters:

  • new_description (String, nil) (defaults to: nil)

    If a String is given, the class'es description will be set.

Returns:

  • (String, nil)

    The class'es or superclass'es description.



60
61
62
63
64
65
66
67
68
# File 'lib/command_kit/description.rb', line 60

def description(new_description=nil)
  if new_description
    @description = new_description
  else
    @description || if superclass.kind_of?(ClassMethods)
                      superclass.description
                    end
  end
end