Class: Yast2::SecretAttributes::Attribute

Inherits:
Object
  • Object
show all
Defined in:
library/general/src/lib/yast2/secret_attributes.rb

Overview

Inner class to store the value of the attribute without exposing it directly

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(value) ⇒ Attribute

Returns a new instance of Attribute.



30
31
32
# File 'library/general/src/lib/yast2/secret_attributes.rb', line 30

def initialize(value)
  @value = value
end

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



28
29
30
# File 'library/general/src/lib/yast2/secret_attributes.rb', line 28

def value
  @value
end

Instance Method Details

#inspectObject



38
39
40
# File 'library/general/src/lib/yast2/secret_attributes.rb', line 38

def inspect
  value.nil? ? "nil" : "<secret>"
end

#instance_variablesObject



42
43
44
45
46
# File 'library/general/src/lib/yast2/secret_attributes.rb', line 42

def instance_variables
  # This adds even an extra barrier, just in case some formatter tries to
  # use deep instrospection
  []
end

#to_sObject



34
35
36
# File 'library/general/src/lib/yast2/secret_attributes.rb', line 34

def to_s
  value.nil? ? "" : "<secret>"
end