Class: OSESecret

Inherits:
Object
  • Object
show all
Defined in:
lib/models/ose_secret.rb

Direct Known Subclasses

K8SSecret

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, ose_secret) ⇒ OSESecret

Returns a new instance of OSESecret.



6
7
8
9
# File 'lib/models/ose_secret.rb', line 6

def initialize(name, ose_secret)
  @name = name
  @ose_secret = ose_secret
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



4
5
6
# File 'lib/models/ose_secret.rb', line 4

def name
  @name
end

#ose_secretObject (readonly)

Returns the value of attribute ose_secret.



4
5
6
# File 'lib/models/ose_secret.rb', line 4

def ose_secret
  @ose_secret
end

Class Method Details

.allObject



38
39
40
# File 'lib/models/ose_secret.rb', line 38

def all
  OSEAdapter.new.fetch_all_secrets.map { |s| OSESecretSerializer.from_yaml(s) }
end

.find_by_name(name) ⇒ Object



34
35
36
# File 'lib/models/ose_secret.rb', line 34

def find_by_name(name)
  OSESecretSerializer.from_yaml(OSEAdapter.new.fetch_secret(name))
end

.from_yaml(yaml) ⇒ Object



30
31
32
# File 'lib/models/ose_secret.rb', line 30

def from_yaml(yaml)
  OSESecretSerializer.from_yaml(yaml)
end

Instance Method Details

#to_encryptableObject



11
12
13
# File 'lib/models/ose_secret.rb', line 11

def to_encryptable
  OSESecretSerializer.to_encryptable(self)
end

#to_yamlObject



15
16
17
# File 'lib/models/ose_secret.rb', line 15

def to_yaml
  OSESecretSerializer.to_yaml(self)
end