Class: Services::UpdatePublicKeyContext

Inherits:
Object
  • Object
show all
Defined in:
app/contexts/services/update_public_key_context.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(public_key, params) ⇒ UpdatePublicKeyContext

Returns a new instance of UpdatePublicKeyContext.



11
12
13
14
15
# File 'app/contexts/services/update_public_key_context.rb', line 11

def initialize(public_key, params)
  @public_key = public_key
  @params = params
  @public_key.extend Services::PublicKeyUpdater
end

Instance Attribute Details

#paramsObject

Returns the value of attribute params.



5
6
7
# File 'app/contexts/services/update_public_key_context.rb', line 5

def params
  @params
end

#public_keyObject

Returns the value of attribute public_key.



5
6
7
# File 'app/contexts/services/update_public_key_context.rb', line 5

def public_key
  @public_key
end

Class Method Details

.call(public_key, params) ⇒ Object



7
8
9
# File 'app/contexts/services/update_public_key_context.rb', line 7

def self.call(public_key, params)
  UpdatePublicKeyContext.new(public_key, params).call
end

Instance Method Details

#callObject



17
18
19
# File 'app/contexts/services/update_public_key_context.rb', line 17

def call
  public_key.update(params)
end