kelredd-useful 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/useful/ruby_extensions/hash.rb +4 -2
- data/lib/useful/version.rb +1 -1
- metadata +1 -1
@@ -91,8 +91,10 @@ module Useful
|
|
91
91
|
# # => "id=thomas_hardy"
|
92
92
|
# {:id => 23423, :since => Time.now}.to_http_str
|
93
93
|
# # => "since=Thu,%2021%20Jun%202007%2012:10:05%20-0500&id=23423"
|
94
|
-
def
|
95
|
-
|
94
|
+
def to_http_query_str(opts = {})
|
95
|
+
opts[:prepend] ||= '?'
|
96
|
+
opts[:append] ||= ''
|
97
|
+
self.empty? ? '' : "#{opts[:prepend]}#{self.collect{|key, val| "#{key.to_s}=#{CGI.escape(val.to_s)}"}.join('&')}#{opts[:append]}"
|
96
98
|
end
|
97
99
|
|
98
100
|
def to_html_attrs
|
data/lib/useful/version.rb
CHANGED