Class: K8::SecretValue
- Inherits:
-
Object
- Object
- K8::SecretValue
- Defined in:
- lib/keight.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #[](name) ⇒ Object
-
#initialize(name = nil) ⇒ SecretValue
constructor
A new instance of SecretValue.
- #to_s ⇒ Object (also: #inspect)
- #value ⇒ Object
Constructor Details
#initialize(name = nil) ⇒ SecretValue
Returns a new instance of SecretValue.
1592 1593 1594 1595 |
# File 'lib/keight.rb', line 1592 def initialize(name=nil) #; [!fbwnh] takes environment variable name. @name = name end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
1597 1598 1599 |
# File 'lib/keight.rb', line 1597 def name @name end |
Instance Method Details
#[](name) ⇒ Object
1613 1614 1615 1616 |
# File 'lib/keight.rb', line 1613 def [](name) #; [!jjqmn] creates new instance object with name. self.class.new(name) end |
#to_s ⇒ Object Also known as: inspect
1604 1605 1606 1607 1608 |
# File 'lib/keight.rb', line 1604 def to_s #; [!7ymqq] returns '<SECRET>' string when name not eixst. #; [!x6edf] returns 'ENV[<name>]' string when name exists. return @name ? "ENV['#{@name}']" : "<SECRET>" end |
#value ⇒ Object
1599 1600 1601 1602 |
# File 'lib/keight.rb', line 1599 def value #; [!gg06v] returns environment variable value. return @name ? ENV[@name] : nil end |