Module: CommandKit::Options::Verbose::ModuleMethods Private
- Included in:
- CommandKit::Options::Verbose
- Defined in:
- lib/command_kit/options/verbose.rb
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.
Instance Method Summary collapse
-
#included(context) ⇒ Object
private
Defines a
-v, --verbose
option or extends ModuleMethods, depending on whether CommandKit::Options::Verbose is being included into a class or a module.
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::Verbose::ModuleMethods, depending
on whether CommandKit::Options::Verbose is being included into a class or a
module.
35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/command_kit/options/verbose.rb', line 35 def included(context) super(context) if context.class == Module context.extend ModuleMethods else context.option :verbose, short: '-v', desc: 'Enables verbose output' do @verbose = true end end end |