Sha256: c06ef9c96abc297c1d8ceadec5a7e49ae30d22d5a1ab53348fd93cee363cf76d

Contents?: true

Size: 829 Bytes

Versions: 6

Compression:

Stored size: 829 Bytes

Contents

require 'puppet/property/list'

module Puppet
  class Property
    # 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 {Puppet::Property::List}.
    #
    class OrderedList < List

      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 = should + (current - should)
        end
        should
      end

      def dearrayify(array)
        array.join(delimiter)
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 2 rubygems

Version Path
librarian-puppet-0.9.9 vendor/gems/ruby/1.9.1/gems/puppet-3.1.0/lib/puppet/property/ordered_list.rb
puppet-3.1.1 lib/puppet/property/ordered_list.rb
librarian-puppet-0.9.8 vendor/gems/ruby/1.9.1/gems/puppet-3.1.0/lib/puppet/property/ordered_list.rb
puppet-3.1.0 lib/puppet/property/ordered_list.rb
puppet-3.1.0.rc2 lib/puppet/property/ordered_list.rb
puppet-3.1.0.rc1 lib/puppet/property/ordered_list.rb