Class: Puppet::Property::OrderedList
- Defined in:
- lib/puppet/property/ordered_list.rb
Overview
This subclass of Puppet::Property manages an ordered list of values. The maintained order is the order defined by the 'current' set of values (i.e. the original order is not disrupted). Any additions are added after the current values in their given order).
For an unordered list see List.
Instance Method Summary collapse
Methods inherited from List
#delimiter, #inclusive?, #insync?, #is_to_s, #membership, #prepare_is_for_comparison, #retrieve, #should
Instance Method Details
#add_should_with_current(should, current) ⇒ Object
15 16 17 18 19 20 21 22 23 |
# File 'lib/puppet/property/ordered_list.rb', line 15 def add_should_with_current(should, current) if current.is_a?(Array) # tricky trick # Preserve all the current items in the list # but move them to the back of the line should += (current - should) end should end |
#dearrayify(array) ⇒ Object
25 26 27 |
# File 'lib/puppet/property/ordered_list.rb', line 25 def dearrayify(array) array.join(delimiter) end |