Merge pull request #1098 from gkarekinian/style

Switched code style to a more usual Ruby style
This commit is contained in:
Parker Moore 2013-03-05 05:22:15 -08:00
commit a63bb4f701

View File

@ -17,24 +17,28 @@ class Hash
target
end
def to_symbol_keys
inject({}) do |memo,(k,v)|
if v.is_a? Hash
memo[k.to_sym] = v.to_symbol_keys
else
memo[k.to_sym] = v;
end
memo
end
inject({}) do |memo, (k, v)|
if v.is_a? Hash
memo[k.to_sym] = v.to_symbol_keys
else
memo[k.to_sym] = v
end
memo
end
end
def to_string_keys
inject({}) do |memo,(k,v)|
if v.is_a? Hash
memo[k.to_s] = v.to_string_keys
else
memo[k.to_s] = v;
end
memo
end
inject({}) do |memo, (k, v)|
if v.is_a? Hash
memo[k.to_s] = v.to_string_keys
else
memo[k.to_s] = v
end
memo
end
end
end