Module: RubyExtension::String::InstanceMethods

Defined in:
lib/ruby_extension/string.rb

Overview

module ClassMethods # :nodoc:

end

Instance Method Summary collapse

Instance Method Details

#to_params_hashObject

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



17
18
19
20
21
22
23
24
# File 'lib/ruby_extension/string.rb', line 17

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



27
28
29
# File 'lib/ruby_extension/string.rb', line 27

def uniq
	self
end