Class: Services::CreateCredentialContext

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(credentialled_object, params) ⇒ CreateCredentialContext

Returns a new instance of CreateCredentialContext.



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

def initialize(credentialled_object, params)
  @credentialled_object = credentialled_object
  @params = params
  @credentialled_object.extend Services::CredentialCreator
end

Instance Attribute Details

#credentialled_objectObject

Returns the value of attribute credentialled_object.



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

def credentialled_object
  @credentialled_object
end

#paramsObject

Returns the value of attribute params.



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

def params
  @params
end

Class Method Details

.call(credentialled_object, params) ⇒ Object



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

def self.call(credentialled_object, params)
  CreateCredentialContext.new(credentialled_object, params).call
end

Instance Method Details

#callObject



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

def call
  credentialled_object.add_credential(params)
end