Sha256: 7b5f2d5e09648983137418cacd80df4ad32b6971a07bc81b088ff3f19e0bef93

Contents?: true

Size: 353 Bytes

Versions: 2

Compression:

Stored size: 353 Bytes

Contents

module Riak
  module Util
    module Escape
      # URI-escapes bucket or key names that may contain slashes for use in URLs.
      # @param [String] bucket_or_key the bucket or key name
      # @return [String] the escaped path segment
      def escape(bucket_or_key)
        URI.escape(bucket_or_key.to_s).gsub("/", "%2F")
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
riak-client-0.7.1 lib/riak/util/escape.rb
riak-client-0.7.0 lib/riak/util/escape.rb