Class: GsmEnv::Secret

Inherits:
Object
  • Object
show all
Defined in:
lib/gsm_env/secret.rb

Defined Under Namespace

Classes: InvalidName

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(secret, version) ⇒ Secret

Returns a new instance of Secret.



9
10
11
12
# File 'lib/gsm_env/secret.rb', line 9

def initialize(secret, version)
  @secret = secret
  @version = version
end

Instance Attribute Details

#secretObject (readonly)

Returns the value of attribute secret.



7
8
9
# File 'lib/gsm_env/secret.rb', line 7

def secret
  @secret
end

#versionObject (readonly)

Returns the value of attribute version.



7
8
9
# File 'lib/gsm_env/secret.rb', line 7

def version
  @version
end

Instance Method Details

#nameObject



14
15
16
# File 'lib/gsm_env/secret.rb', line 14

def name
  @name ||= extract_secret_name_from(secret.name)
end

#valueObject



18
19
20
# File 'lib/gsm_env/secret.rb', line 18

def value
  version.payload.data&.chomp
end