httparty 0.2.1 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of httparty might be problematic. Click here for more details.
- 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