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-retrospec-0.12.2 vendor/gems/puppet-3.7.3/lib/puppet/vendor/safe_yaml/lib/safe_yaml/transform/to_symbol.rb
puppet-3.8.7 lib/puppet/vendor/safe_yaml/lib/safe_yaml/transform/to_symbol.rb
puppet-3.8.7-x86-mingw32 lib/puppet/vendor/safe_yaml/lib/safe_yaml/transform/to_symbol.rb
puppet-3.8.7-x64-mingw32 lib/puppet/vendor/safe_yaml/lib/safe_yaml/transform/to_symbol.rb
puppet-3.8.6 lib/puppet/vendor/safe_yaml/lib/safe_yaml/transform/to_symbol.rb
puppet-3.8.6-x86-mingw32 lib/puppet/vendor/safe_yaml/lib/safe_yaml/transform/to_symbol.rb
puppet-retrospec-0.12.1 vendor/gems/puppet-3.7.3/lib/puppet/vendor/safe_yaml/lib/safe_yaml/transform/to_symbol.rb
puppet-3.8.6-x64-mingw32 lib/puppet/vendor/safe_yaml/lib/safe_yaml/transform/to_symbol.rb
puppet-retrospec-0.12.0 vendor/gems/puppet-3.7.3/lib/puppet/vendor/safe_yaml/lib/safe_yaml/transform/to_symbol.rb
puppet-3.8.5 lib/puppet/vendor/safe_yaml/lib/safe_yaml/transform/to_symbol.rb
puppet-3.8.5-x86-mingw32 lib/puppet/vendor/safe_yaml/lib/safe_yaml/transform/to_symbol.rb
puppet-3.8.5-x64-mingw32 lib/puppet/vendor/safe_yaml/lib/safe_yaml/transform/to_symbol.rb
puppet-3.8.4 lib/puppet/vendor/safe_yaml/lib/safe_yaml/transform/to_symbol.rb
puppet-3.8.4-x86-mingw32 lib/puppet/vendor/safe_yaml/lib/safe_yaml/transform/to_symbol.rb
puppet-3.8.4-x64-mingw32 lib/puppet/vendor/safe_yaml/lib/safe_yaml/transform/to_symbol.rb
puppet-retrospec-0.11.0 vendor/gems/puppet-3.7.3/lib/puppet/vendor/safe_yaml/lib/safe_yaml/transform/to_symbol.rb
puppet-retrospec-0.10.0 vendor/gems/puppet-3.7.3/lib/puppet/vendor/safe_yaml/lib/safe_yaml/transform/to_symbol.rb
puppet-retrospec-0.9.1 vendor/gems/puppet-3.7.3/lib/puppet/vendor/safe_yaml/lib/safe_yaml/transform/to_symbol.rb
puppet-retrospec-0.9.0 vendor/gems/puppet-3.7.3/lib/puppet/vendor/safe_yaml/lib/safe_yaml/transform/to_symbol.rb
puppet-retrospec-0.8.1 vendor/gems/puppet-3.7.3/lib/puppet/vendor/safe_yaml/lib/safe_yaml/transform/to_symbol.rb