jnunemaker-httparty 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- data/History +4 -0
- data/httparty.gemspec +1 -1
- data/lib/core_extensions.rb +11 -0
- data/lib/httparty/version.rb +1 -1
- metadata +1 -1
data/History
CHANGED
data/httparty.gemspec
CHANGED
data/lib/core_extensions.rb
CHANGED
@@ -333,4 +333,15 @@ class Hash
|
|
333
333
|
|
334
334
|
param
|
335
335
|
end
|
336
|
+
|
337
|
+
# @return <String> The hash as attributes for an XML tag.
|
338
|
+
#
|
339
|
+
# @example
|
340
|
+
# { :one => 1, "two"=>"TWO" }.to_xml_attributes
|
341
|
+
# #=> 'one="1" two="TWO"'
|
342
|
+
def to_xml_attributes
|
343
|
+
map do |k,v|
|
344
|
+
%{#{k.to_s.snake_case.sub(/^(.{1,1})/) { |m| m.downcase }}="#{v}"}
|
345
|
+
end.join(' ')
|
346
|
+
end
|
336
347
|
end
|
data/lib/httparty/version.rb
CHANGED