Class: Services::EnvironmentDestroyer

Inherits:
Object
  • Object
show all
Defined in:
lib/busbar_cli/services/environment_destroyer.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(environment) ⇒ EnvironmentDestroyer

Returns a new instance of EnvironmentDestroyer.



7
8
9
# File 'lib/busbar_cli/services/environment_destroyer.rb', line 7

def initialize(environment)
  @environment = environment
end

Class Method Details

.call(environment) ⇒ Object



3
4
5
# File 'lib/busbar_cli/services/environment_destroyer.rb', line 3

def self.call(environment)
  new(environment).call
end

Instance Method Details

#callObject



11
12
13
14
15
16
17
# File 'lib/busbar_cli/services/environment_destroyer.rb', line 11

def call
  confirm

  EnvironmentsRepository.destroy(environment: @environment)

  puts "Environment #{@environment.app_id} #{@environment.name} is scheduled for destruction"
end