Class: RSpec::Puppet::Sensitive

Inherits:
Puppet::Pops::Types::PSensitiveType::Sensitive
  • Object
show all
Defined in:
lib/rspec-puppet/sensitive.rb,
lib/rspec-puppet/sensitive.rb

Overview

:nocov:

Instance Method Summary collapse

Constructor Details

#initialize(value) ⇒ Sensitive

Create a new Sensitive object

Parameters:

  • value (Object)

    to wrap



7
8
9
# File 'lib/rspec-puppet/sensitive.rb', line 7

def initialize(value)
  @value = value
end

Instance Method Details

#==(other) ⇒ Object

Parameters:

  • other (#unwrap, Object)

    value to compare to



30
31
32
33
34
35
36
# File 'lib/rspec-puppet/sensitive.rb', line 30

def == other
  if other.respond_to? :unwrap
    return unwrap == other.unwrap
  else
    super
  end
end

#inspectObject

Returns inspect of the wrapped value, inside Sensitive().

Returns:

  • inspect of the wrapped value, inside Sensitive()



22
23
24
# File 'lib/rspec-puppet/sensitive.rb', line 22

def inspect
  "Sensitive(#{@value.inspect})"
end

#sensitive?Boolean

Returns true.

Returns:

  • (Boolean)

    true



17
18
19
# File 'lib/rspec-puppet/sensitive.rb', line 17

def sensitive?
  true
end

#unwrapObject

Returns the wrapped value.

Returns:

  • the wrapped value



12
13
14
# File 'lib/rspec-puppet/sensitive.rb', line 12

def unwrap
  @value
end