19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
# File 'lib/cred_hubble/resources/credential_factory.rb', line 19
def self.credential_from_data(credential_data)
case credential_data['type']
when Credential::VALUE_TYPE
ValueCredential.new(credential_data)
when Credential::JSON_TYPE
JsonCredential.new(credential_data)
when Credential::PASSWORD_TYPE
PasswordCredential.new(credential_data)
when Credential::USER_TYPE
UserCredential.new(credential_data)
when Credential::CERTIFICATE_TYPE
CertificateCredential.new(credential_data)
when Credential::RSA_TYPE
RsaCredential.new(credential_data)
when Credential::SSH_TYPE
SshCredential.new(credential_data)
else
Credential.new(credential_data)
end
end
|