Class: FluidCLI::Commands::Switch

Inherits:
FluidCLI::Command show all
Defined in:
lib/fluid_cli/commands/switch.rb

Instance Attribute Summary

Attributes inherited from FluidCLI::Command

#ctx, #options

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from FluidCLI::Command

call, call_help, #initialize, options, subcommand, subcommand_registry

Constructor Details

This class inherits a constructor from FluidCLI::Command

Class Method Details

.helpObject



18
19
20
# File 'lib/fluid_cli/commands/switch.rb', line 18

def self.help
  "Switches the current company context."
end

Instance Method Details

#callObject



10
11
12
13
14
15
16
# File 'lib/fluid_cli/commands/switch.rb', line 10

def call(*)
  company = FluidCLI::CompanySwitcher.new(
    ctx: @ctx,
    company: options.flags[:company]
  ).switch
  @ctx.puts("Switched to company '#{company['name']}' successfully.")
end