Class: ICSP::Commands::BaseCommand

Inherits:
Object
  • Object
show all
Defined in:
lib/commands/base_command.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(config:, options:, arguments:) ⇒ BaseCommand

Returns a new instance of BaseCommand.



6
7
8
9
10
11
12
13
14
# File 'lib/commands/base_command.rb', line 6

def initialize(config:, options:, arguments:)
  @config = config
  @options = options
  @arguments = arguments
  @prompt = TTY::Prompt.new
  ::ICSP.logger.debug('Command initialized with:')
  ::ICSP.logger.debug("arguments: #{@arguments.inspect}")
  ::ICSP.logger.debug("options: #{@options.inspect}")
end

Instance Attribute Details

#argumentsObject (readonly)

Returns the value of attribute arguments.



16
17
18
# File 'lib/commands/base_command.rb', line 16

def arguments
  @arguments
end

#configObject (readonly)

Returns the value of attribute config.



16
17
18
# File 'lib/commands/base_command.rb', line 16

def config
  @config
end

#optionsObject (readonly)

Returns the value of attribute options.



16
17
18
# File 'lib/commands/base_command.rb', line 16

def options
  @options
end

#promptObject (readonly)

Returns the value of attribute prompt.



16
17
18
# File 'lib/commands/base_command.rb', line 16

def prompt
  @prompt
end