Class: Ci::NamespaceSettings::UpdateService

Inherits:
Object
  • Object
show all
Defined in:
app/services/ci/namespace_settings/update_service.rb

Instance Method Summary collapse

Constructor Details

#initialize(settings, args) ⇒ UpdateService

Returns a new instance of UpdateService.



6
7
8
9
# File 'app/services/ci/namespace_settings/update_service.rb', line 6

def initialize(settings, args)
  @settings = settings
  @args = args
end

Instance Method Details

#executeObject



11
12
13
14
15
16
17
# File 'app/services/ci/namespace_settings/update_service.rb', line 11

def execute
  return ServiceResponse.success if settings.update(args)

  ServiceResponse.error(message: settings.errors.full_messages)
rescue ArgumentError => e
  ServiceResponse.error(message: [e.message])
end