Class: PuppetX::Sensu::ArrayProperty

Inherits:
Puppet::Property
  • Object
show all
Defined in:
lib/puppet_x/sensu/array_property.rb

Instance Method Summary collapse

Instance Method Details

#change_to_s(currentvalue, newvalue) ⇒ Object



18
19
20
21
22
# File 'lib/puppet_x/sensu/array_property.rb', line 18

def change_to_s(currentvalue, newvalue)
  currentvalue = currentvalue.to_s if currentvalue != :absent
  newvalue = newvalue.to_s
  super(currentvalue, newvalue)
end

#insync?(is) ⇒ Boolean

Returns:

  • (Boolean)


13
14
15
16
# File 'lib/puppet_x/sensu/array_property.rb', line 13

def insync?(is)
  return is.sort == should.sort if is.is_a?(Array) && should.is_a?(Array)
  is == should
end

#is_to_s(currentvalue) ⇒ Object Also known as: should_to_s



24
25
26
# File 'lib/puppet_x/sensu/array_property.rb', line 24

def is_to_s(currentvalue)
  currentvalue.to_s
end

#shouldObject



5
6
7
8
9
10
11
# File 'lib/puppet_x/sensu/array_property.rb', line 5

def should
  if @should and @should[0] == :absent
    :absent
  else
    @should
  end
end