Module: Yast2::SecretAttributes::ClassMethods
- Defined in:
- library/general/src/lib/yast2/secret_attributes.rb
Overview
Class methods for the mixin
Instance Method Summary collapse
-
#secret_attr(name) ⇒ Object
Similar to .attr_accessor but with additional mechanisms to prevent exposing the internal value of the attribute.
Instance Method Details
#secret_attr(name) ⇒ Object
Similar to .attr_accessor but with additional mechanisms to prevent exposing the internal value of the attribute
68 69 70 71 72 73 74 75 76 77 78 |
# File 'library/general/src/lib/yast2/secret_attributes.rb', line 68 def secret_attr(name) define_method(:"#{name}") do attribute = instance_variable_get(:"@#{name}") attribute ? attribute.value : nil end define_method(:"#{name}=") do |value| instance_variable_set(:"@#{name}", Attribute.new(value)) value end end |