Class: Ci::Runners::UnregisterRunnerService

Inherits:
Object
  • Object
show all
Defined in:
app/services/ci/runners/unregister_runner_service.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(runner, author) ⇒ UnregisterRunnerService

Returns a new instance of UnregisterRunnerService.

Parameters:

  • runner (Ci::Runner)

    the runner to unregister/destroy

  • author (User, authentication token String)

    the user or the authentication token that authorizes the removal



10
11
12
13
# File 'app/services/ci/runners/unregister_runner_service.rb', line 10

def initialize(runner, author)
  @runner = runner
  @author = author
end

Instance Attribute Details

#authorObject (readonly)

Returns the value of attribute author.



6
7
8
# File 'app/services/ci/runners/unregister_runner_service.rb', line 6

def author
  @author
end

#runnerObject (readonly)

Returns the value of attribute runner.



6
7
8
# File 'app/services/ci/runners/unregister_runner_service.rb', line 6

def runner
  @runner
end

Instance Method Details

#executeObject



15
16
17
18
19
# File 'app/services/ci/runners/unregister_runner_service.rb', line 15

def execute
  runner.destroy!

  ServiceResponse.success
end