Class: RSpec::Puppet::Sensitive
- Inherits:
-
Puppet::Pops::Types::PSensitiveType::Sensitive
- Object
- Puppet::Pops::Types::PSensitiveType::Sensitive
- RSpec::Puppet::Sensitive
- Defined in:
- lib/rspec-puppet/sensitive.rb
Overview
A wrapper representing Sensitive data type, eg. in class params.
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(value) ⇒ Sensitive
constructor
Create a new Sensitive object.
-
#inspect ⇒ Object
Inspect of the wrapped value, inside Sensitive().
-
#sensitive? ⇒ Boolean
True.
-
#to_s ⇒ Object
The unwrapped value (needed to show diff).
-
#unwrap ⇒ Object
The wrapped value.
Constructor Details
#initialize(value) ⇒ Sensitive
Create a new Sensitive object
8 9 10 |
# File 'lib/rspec-puppet/sensitive.rb', line 8 def initialize(value) @value = value end |
Instance Method Details
#==(other) ⇒ Object
36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/rspec-puppet/sensitive.rb', line 36 def ==(other) if other.respond_to? :unwrap if unwrap.is_a?(Regexp) unwrap =~ other.unwrap else unwrap == other.unwrap end else super end end |
#inspect ⇒ Object
Returns inspect of the wrapped value, inside Sensitive().
23 24 25 |
# File 'lib/rspec-puppet/sensitive.rb', line 23 def inspect "Sensitive(#{@value.inspect})" end |
#sensitive? ⇒ Boolean
Returns true.
18 19 20 |
# File 'lib/rspec-puppet/sensitive.rb', line 18 def sensitive? true end |
#to_s ⇒ Object
Returns the unwrapped value (needed to show diff).
28 29 30 |
# File 'lib/rspec-puppet/sensitive.rb', line 28 def to_s inspect end |
#unwrap ⇒ Object
Returns the wrapped value.
13 14 15 |
# File 'lib/rspec-puppet/sensitive.rb', line 13 def unwrap @value end |