Sha256: 08edc3c598daeda11b29609d5571ff81574b98bdba6d9d9a22528337331a8275

Contents?: true

Size: 322 Bytes

Versions: 15

Compression:

Stored size: 322 Bytes

Contents

module SafeYAML
  class Transform
    class ToNil
      PREDEFINED_VALUES = {
        ""      => nil,
        "~"     => nil,
        "null"  => nil,
      }.freeze

      def transform?(value)
        key = value.downcase
        return PREDEFINED_VALUES.include?(key), PREDEFINED_VALUES[key]
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
safe_yaml-0.9.0 lib/safe_yaml/transform/to_nil.rb
safe_yaml-0.8.6 lib/safe_yaml/transform/to_nil.rb
safe_yaml-0.8.5 lib/safe_yaml/transform/to_nil.rb
safe_yaml-0.8.4 lib/safe_yaml/transform/to_nil.rb
safe_yaml-0.8.3 lib/safe_yaml/transform/to_nil.rb
safe_yaml-0.8.2 lib/safe_yaml/transform/to_nil.rb
safe_yaml-0.8.1 lib/safe_yaml/transform/to_nil.rb
safe_yaml-0.8.0 lib/safe_yaml/transform/to_nil.rb
safe_yaml-0.7.1 lib/safe_yaml/transform/to_nil.rb
safe_yaml-0.7.0 lib/safe_yaml/transform/to_nil.rb
safe_yaml-0.6.3 lib/safe_yaml/transform/to_nil.rb
safe_yaml-0.6.2 lib/safe_yaml/transform/to_nil.rb
safe_yaml-0.6.1 lib/safe_yaml/transform/to_nil.rb
safe_yaml-0.5.2 lib/safe_yaml/transform/to_nil.rb
safe_yaml-0.5.1 lib/safe_yaml/transform/to_nil.rb