Sha256: dca7d0a71a00d0647e72887412fdb0071d5a52ef6083fca3529c4605a1dac29c

Contents?: true

Size: 494 Bytes

Versions: 23

Compression:

Stored size: 494 Bytes

Contents

class Hash
  unless method_defined?(:to_query)
    def to_query
      elements = []
      self.each do |key, value|
        elements << "#{CGI::escape(key.to_s)}=#{CGI::escape(value.to_s)}"
      end
      elements.join('&')
    end
  end

  unless method_defined?(:reverse_merge)
    def reverse_merge(other_hash)
      other_hash.merge(self)
    end
  end

  unless method_defined?(:reverse_merge!)
    def reverse_merge!(other_hash)
      replace(reverse_merge(other_hash))
    end
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
solusvm-1.4.0 lib/solusvm/hash.rb
solusvm-1.3.1 lib/solusvm/hash.rb
solusvm-1.3.0 lib/solusvm/hash.rb
solusvm-1.2.1 lib/solusvm/hash.rb
solusvm-1.2.0 lib/solusvm/hash.rb
solusvm-1.1.0.beta2 lib/solusvm/hash.rb
solusvm-1.1.0.beta1 lib/solusvm/hash.rb
solusvm-1.0.0.beta3 lib/solusvm/hash.rb
solusvm-1.0.0.beta2 lib/solusvm/hash.rb
solusvm-1.0.0.beta lib/solusvm/hash.rb
solusvm-0.10.1 lib/solusvm/hash.rb
solusvm-0.10.0 lib/solusvm/hash.rb
solusvm-0.9.0 lib/solusvm/hash.rb
solusvm-0.8.1 lib/solusvm/hash.rb
solusvm-0.7.0 lib/solusvm/hash.rb
solusvm-0.6.1 lib/solusvm/hash.rb
solusvm-0.6.0 lib/solusvm/hash.rb
solusvm-0.5.1 lib/solusvm/hash.rb
solusvm-0.4.3 lib/solusvm/hash.rb
solusvm-0.4.2 lib/solusvm/hash.rb