Class: GpgKeys::CreateService

Inherits:
Keys::BaseService show all
Defined in:
app/services/gpg_keys/create_service.rb

Instance Attribute Summary

Attributes inherited from Keys::BaseService

#params, #user

Instance Method Summary collapse

Methods inherited from Keys::BaseService

#initialize, #notification_service, #todo_service

Constructor Details

This class inherits a constructor from Keys::BaseService

Instance Method Details

#executeObject



5
6
7
8
9
10
11
12
13
14
# File 'app/services/gpg_keys/create_service.rb', line 5

def execute
  key = user.gpg_keys.build(params)

  return key unless validate(key)

  create(key)

  notification_service.new_gpg_key(key) if key.persisted?
  key
end