Class: Clin::GeneralOption

Inherits:
Object
  • Object
show all
Includes:
CommandMixin::Options
Defined in:
lib/clin/general_option.rb

Overview

Parent class for reusable options across commands

Direct Known Subclasses

HelpOptions

Instance Method Summary collapse

Constructor Details

#initialize(_config = {}) ⇒ GeneralOption

Returns a new instance of GeneralOption.



7
8
# File 'lib/clin/general_option.rb', line 7

def initialize(_config = {})
end

Instance Method Details

#execute(_params) ⇒ Object

It get the params the general options needs and do whatever the option is suppose to do with it. Method called in the initialize of the command. This allow general options to be extracted when parsing a command line as well as calling the command directly in the code

Parameters:

  • _params (Hash)

    Params got in the command



15
16
# File 'lib/clin/general_option.rb', line 15

def execute(_params)
end