Sha256: 6545004970c26d3accf2cdfcdb1d3fa425b47af7c8279fb08e282e85d1bec4dc

Contents?: true

Size: 684 Bytes

Versions: 170

Compression:

Stored size: 684 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::Resource
      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

170 entries across 170 versions & 5 rubygems

Version Path
puppet-retrospec-0.12.2 vendor/gems/puppet-3.7.3/lib/puppet/util/rails/reference_serializer.rb
puppet-3.8.7 lib/puppet/util/rails/reference_serializer.rb
puppet-3.8.7-x86-mingw32 lib/puppet/util/rails/reference_serializer.rb
puppet-3.8.7-x64-mingw32 lib/puppet/util/rails/reference_serializer.rb
puppet-3.8.6 lib/puppet/util/rails/reference_serializer.rb
puppet-3.8.6-x86-mingw32 lib/puppet/util/rails/reference_serializer.rb
puppet-retrospec-0.12.1 vendor/gems/puppet-3.7.3/lib/puppet/util/rails/reference_serializer.rb
puppet-3.8.6-x64-mingw32 lib/puppet/util/rails/reference_serializer.rb
puppet-retrospec-0.12.0 vendor/gems/puppet-3.7.3/lib/puppet/util/rails/reference_serializer.rb
puppet-3.8.5 lib/puppet/util/rails/reference_serializer.rb
puppet-3.8.5-x86-mingw32 lib/puppet/util/rails/reference_serializer.rb
puppet-3.8.5-x64-mingw32 lib/puppet/util/rails/reference_serializer.rb
puppet-3.8.4 lib/puppet/util/rails/reference_serializer.rb
puppet-3.8.4-x86-mingw32 lib/puppet/util/rails/reference_serializer.rb
puppet-3.8.4-x64-mingw32 lib/puppet/util/rails/reference_serializer.rb
puppet-retrospec-0.11.0 vendor/gems/puppet-3.7.3/lib/puppet/util/rails/reference_serializer.rb
puppet-retrospec-0.10.0 vendor/gems/puppet-3.7.3/lib/puppet/util/rails/reference_serializer.rb
puppet-retrospec-0.9.1 vendor/gems/puppet-3.7.3/lib/puppet/util/rails/reference_serializer.rb
puppet-retrospec-0.9.0 vendor/gems/puppet-3.7.3/lib/puppet/util/rails/reference_serializer.rb
puppet-retrospec-0.8.1 vendor/gems/puppet-3.7.3/lib/puppet/util/rails/reference_serializer.rb