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.8.3 lib/puppet/vendor/safe_yaml/lib/safe_yaml/transform/to_symbol.rb
puppet-3.8.3-x86-mingw32 lib/puppet/vendor/safe_yaml/lib/safe_yaml/transform/to_symbol.rb
puppet-3.8.3-x64-mingw32 lib/puppet/vendor/safe_yaml/lib/safe_yaml/transform/to_symbol.rb
puppet-retrospec-0.8.0 vendor/gems/puppet-3.7.3/lib/puppet/vendor/safe_yaml/lib/safe_yaml/transform/to_symbol.rb
puppet-3.8.2 lib/puppet/vendor/safe_yaml/lib/safe_yaml/transform/to_symbol.rb
puppet-3.8.2-x86-mingw32 lib/puppet/vendor/safe_yaml/lib/safe_yaml/transform/to_symbol.rb
puppet-3.8.2-x64-mingw32 lib/puppet/vendor/safe_yaml/lib/safe_yaml/transform/to_symbol.rb
puppet-retrospec-0.7.3 vendor/gems/puppet-3.7.3/lib/puppet/vendor/safe_yaml/lib/safe_yaml/transform/to_symbol.rb
puppet-retrospec-0.7.2 vendor/gems/puppet-3.7.3/lib/puppet/vendor/safe_yaml/lib/safe_yaml/transform/to_symbol.rb
puppet-3.8.1 lib/puppet/vendor/safe_yaml/lib/safe_yaml/transform/to_symbol.rb
puppet-3.8.1-x86-mingw32 lib/puppet/vendor/safe_yaml/lib/safe_yaml/transform/to_symbol.rb
puppet-3.8.1-x64-mingw32 lib/puppet/vendor/safe_yaml/lib/safe_yaml/transform/to_symbol.rb
puppet-3.7.5 lib/puppet/vendor/safe_yaml/lib/safe_yaml/transform/to_symbol.rb
puppet-3.7.5-x86-mingw32 lib/puppet/vendor/safe_yaml/lib/safe_yaml/transform/to_symbol.rb
puppet-3.7.5-x64-mingw32 lib/puppet/vendor/safe_yaml/lib/safe_yaml/transform/to_symbol.rb
puppet-3.7.4 lib/puppet/vendor/safe_yaml/lib/safe_yaml/transform/to_symbol.rb
puppet-3.7.4-x86-mingw32 lib/puppet/vendor/safe_yaml/lib/safe_yaml/transform/to_symbol.rb
puppet-3.7.4-x64-mingw32 lib/puppet/vendor/safe_yaml/lib/safe_yaml/transform/to_symbol.rb
puppet-3.7.3 lib/puppet/vendor/safe_yaml/lib/safe_yaml/transform/to_symbol.rb
puppet-3.7.3-x86-mingw32 lib/puppet/vendor/safe_yaml/lib/safe_yaml/transform/to_symbol.rb