Module: CommonLib::String

Defined in:
lib/common_lib/ruby/string.rb

Overview

:nodoc:

Instance Method Summary collapse

Instance Method Details

#to_params_hashObject

Convert a query string like that in a URL to a Hash



5
6
7
8
9
10
11
12
# File 'lib/common_lib/ruby/string.rb', line 5

def to_params_hash
	h = HashWithIndifferentAccess.new
	self.split('&').each do |p|
		(k,v) = p.split('=',2)
		h[k] = URI.decode(v)
	end
	return h
end

#uniqObject

Return self



15
16
17
# File 'lib/common_lib/ruby/string.rb', line 15

def uniq
	self
end