Class: PuppetX::Sensu::ArrayProperty
- Inherits:
-
Puppet::Property
- Object
- Puppet::Property
- PuppetX::Sensu::ArrayProperty
- Defined in:
- lib/puppet_x/sensu/array_property.rb
Instance Method Summary collapse
- #change_to_s(currentvalue, newvalue) ⇒ Object
- #insync?(is) ⇒ Boolean
- #is_to_s(currentvalue) ⇒ Object (also: #should_to_s)
- #should ⇒ Object
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
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 |
#should ⇒ Object
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 |