Class: Clusters::DestroyService

Inherits:
Object
  • Object
show all
Defined in:
app/services/clusters/destroy_service.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(user = nil, params = {}) ⇒ DestroyService

Returns a new instance of DestroyService.


7
8
9
10
# File 'app/services/clusters/destroy_service.rb', line 7

def initialize(user = nil, params = {})
  @current_user, @params = user, params.dup
  @response = {}
end

Instance Attribute Details

#current_userObject (readonly)

Returns the value of attribute current_user


5
6
7
# File 'app/services/clusters/destroy_service.rb', line 5

def current_user
  @current_user
end

#paramsObject (readonly)

Returns the value of attribute params


5
6
7
# File 'app/services/clusters/destroy_service.rb', line 5

def params
  @params
end

Instance Method Details

#execute(cluster) ⇒ Object


12
13
14
15
16
# File 'app/services/clusters/destroy_service.rb', line 12

def execute(cluster)
  cleanup? ? start_cleanup!(cluster) : destroy_cluster!(cluster)

  @response
end