Class: Escort::ActionCommand::EscortUtilityCommand

Inherits:
Base
  • Object
show all
Defined in:
lib/escort/action_command/escort_utility_command.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#arguments, #config, #options

Instance Method Summary collapse

Constructor Details

#initialize(setup, options, arguments, config = {}) ⇒ EscortUtilityCommand

Returns a new instance of EscortUtilityCommand.



6
7
8
9
# File 'lib/escort/action_command/escort_utility_command.rb', line 6

def initialize(setup, options, arguments, config = {})
  super(options, arguments, config)
  @setup = setup
end

Instance Attribute Details

#setupObject (readonly)

Returns the value of attribute setup.



4
5
6
# File 'lib/escort/action_command/escort_utility_command.rb', line 4

def setup
  @setup
end

Instance Method Details

#executeObject



11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/escort/action_command/escort_utility_command.rb', line 11

def execute
  current_command_options = command_options
  if current_command_options[:create_config_given]
    create_config(current_command_options[:create_config])
  elsif current_command_options[:create_default_config_given]
    create_default_config
  elsif current_command_options[:update_config_given]
    update_config(current_command_options[:update_config])
  elsif current_command_options[:update_default_config_given]
    update_default_config
  end
end