Module: CommandKit::Options::VerboseLevel::ModuleMethods Private

Included in:
CommandKit::Options::VerboseLevel
Defined in:
lib/command_kit/options/verbose_level.rb

Overview

This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.

Since:

  • 0.6.0

Instance Method Summary collapse

Instance Method Details

#included(context) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Defines a -v, --verbose option or extends CommandKit::Options::VerboseLevel::ModuleMethods, depending on whether CommandKit::Options::Verbose is being included into a class or a module.

Parameters:

Since:

  • 0.6.0



43
44
45
46
47
48
49
50
51
52
53
# File 'lib/command_kit/options/verbose_level.rb', line 43

def included(context)
  super(context)

  if context.class == Module
    context.extend ModuleMethods
  else
    context.option :verbose, short: '-v', desc: 'Increases the verbosity level' do
      @verbose += 1
    end
  end
end