Class: OSESecretSerializer

Inherits:
Object
  • Object
show all
Defined in:
lib/serializers/ose_secret_serializer.rb

Class Method Summary collapse

Class Method Details

.from_yaml(yaml) ⇒ Object



7
8
9
10
# File 'lib/serializers/ose_secret_serializer.rb', line 7

def from_yaml(yaml)
  secret_hash = Psych.load(yaml, symbolize_names: true)
  OSESecret.new(secret_hash.dig(:metadata, :name), yaml)
end

.to_account(secret) ⇒ Object



12
13
14
# File 'lib/serializers/ose_secret_serializer.rb', line 12

def (secret)
  Account.new(accountname: secret.name, ose_secret: secret.ose_secret, type: 'ose_secret')
end