Sha256: a450432cc0a7d967cf8e0a6f8d00e8aeca72aaef7a86e1caa4062be18cd2914e

Contents?: true

Size: 314 Bytes

Versions: 95

Compression:

Stored size: 314 Bytes

Contents

module SafeYAML
  class Transform
    class ToSymbol
      MATCHER = /\A:"?(\w+)"?\Z/.freeze

      def transform?(value, options=nil)
        options ||= SafeYAML::OPTIONS
        return false unless options[:deserialize_symbols] && MATCHER.match(value)
        return true, $1.to_sym
      end
    end
  end
end

Version data entries

95 entries across 95 versions & 3 rubygems

Version Path
puppet-3.5.1-x86-mingw32 lib/puppet/vendor/safe_yaml/lib/safe_yaml/transform/to_symbol.rb
puppet-3.5.1.rc1 lib/puppet/vendor/safe_yaml/lib/safe_yaml/transform/to_symbol.rb
puppet-3.5.1.rc1-x86-mingw32 lib/puppet/vendor/safe_yaml/lib/safe_yaml/transform/to_symbol.rb
puppet-3.5.0.rc3 lib/puppet/vendor/safe_yaml/lib/safe_yaml/transform/to_symbol.rb
puppet-3.5.0.rc3-x86-mingw32 lib/puppet/vendor/safe_yaml/lib/safe_yaml/transform/to_symbol.rb
puppet-3.5.0.rc2 lib/puppet/vendor/safe_yaml/lib/safe_yaml/transform/to_symbol.rb
puppet-3.5.0.rc2-x86-mingw32 lib/puppet/vendor/safe_yaml/lib/safe_yaml/transform/to_symbol.rb
puppet-3.5.0.rc1 lib/puppet/vendor/safe_yaml/lib/safe_yaml/transform/to_symbol.rb
puppet-3.5.0.rc1-x86-mingw32 lib/puppet/vendor/safe_yaml/lib/safe_yaml/transform/to_symbol.rb
puppet-3.4.3 lib/puppet/vendor/safe_yaml/lib/safe_yaml/transform/to_symbol.rb
puppet-2.7.25 lib/puppet/vendor/safe_yaml/lib/safe_yaml/transform/to_symbol.rb
puppet-3.4.2 lib/puppet/vendor/safe_yaml/lib/safe_yaml/transform/to_symbol.rb
puppet-2.7.24 lib/puppet/vendor/safe_yaml/lib/safe_yaml/transform/to_symbol.rb
puppet-3.4.1 lib/puppet/vendor/safe_yaml/lib/safe_yaml/transform/to_symbol.rb
puppet-3.4.0 lib/puppet/vendor/safe_yaml/lib/safe_yaml/transform/to_symbol.rb
puppet-3.4.0.rc2 lib/puppet/vendor/safe_yaml/lib/safe_yaml/transform/to_symbol.rb
puppet-3.4.0.rc1 lib/puppet/vendor/safe_yaml/lib/safe_yaml/transform/to_symbol.rb
puppet-3.3.2 lib/puppet/vendor/safe_yaml/lib/safe_yaml/transform/to_symbol.rb
puppet-3.3.1 lib/puppet/vendor/safe_yaml/lib/safe_yaml/transform/to_symbol.rb
puppet-3.3.1.rc3 lib/puppet/vendor/safe_yaml/lib/safe_yaml/transform/to_symbol.rb