Class: Ci::Runners::UpdateRunnerService
- Inherits:
-
Object
- Object
- Ci::Runners::UpdateRunnerService
- Defined in:
- app/services/ci/runners/update_runner_service.rb
Instance Attribute Summary collapse
-
#runner ⇒ Object
readonly
Returns the value of attribute runner.
Instance Method Summary collapse
- #execute(params) ⇒ Object
-
#initialize(runner) ⇒ UpdateRunnerService
constructor
A new instance of UpdateRunnerService.
Constructor Details
#initialize(runner) ⇒ UpdateRunnerService
Returns a new instance of UpdateRunnerService.
8 9 10 |
# File 'app/services/ci/runners/update_runner_service.rb', line 8 def initialize(runner) @runner = runner end |
Instance Attribute Details
#runner ⇒ Object (readonly)
Returns the value of attribute runner.
6 7 8 |
# File 'app/services/ci/runners/update_runner_service.rb', line 6 def runner @runner end |
Instance Method Details
#execute(params) ⇒ Object
12 13 14 15 16 17 18 19 20 21 |
# File 'app/services/ci/runners/update_runner_service.rb', line 12 def execute(params) params[:active] = !params.delete(:paused) if params.include?(:paused) if runner.update(params) runner.tick_runner_queue ServiceResponse.success else ServiceResponse.error(message: runner.errors.) end end |