Sha256: e4330042cb1501cc91c720b32bc17094fe2d0252aa2af3534468b7ea52488c11

Contents?: true

Size: 833 Bytes

Versions: 6

Compression:

Stored size: 833 Bytes

Contents

module Puppet::Util::ReferenceSerializer
    def unserialize_value(val)
        case val
        when /^--- /
            YAML.load(val)
        when "true"
            true
        when "false"
            false
        else
            val
        end
    end

    def serialize_value(val)
        case val
        when Puppet::Parser::Resource::Reference
            YAML.dump(val)
        when true, false
            # The database does this for us, but I prefer the
            # methods be their exact inverses.
            # Note that this means quoted booleans get returned
            # as actual booleans, but there doesn't appear to be
            # a way to fix that while keeping the ability to
            # search for parameters set to true.
            val.to_s
        else
            val
        end
    end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
puppet-0.25.5 lib/puppet/util/rails/reference_serializer.rb
puppet-0.25.4 lib/puppet/util/rails/reference_serializer.rb
puppet-0.25.3 lib/puppet/util/rails/reference_serializer.rb
puppet-0.25.2 lib/puppet/util/rails/reference_serializer.rb
puppet-0.25.1 lib/puppet/util/rails/reference_serializer.rb
puppet-0.25.0 lib/puppet/util/rails/reference_serializer.rb