Corrected with rubocop cop 'Style/EachWithObject'.

This commit is contained in:
Thorsten Eckel 2015-05-05 16:56:12 +02:00
parent 492c07cd95
commit bfa6f11221
2 changed files with 1 additions and 4 deletions

View file

@ -236,8 +236,6 @@ Metrics/BlockNesting:
Enabled: false Enabled: false
Lint/RescueException: Lint/RescueException:
Enabled: false Enabled: false
Style/EachWithObject:
Enabled: false
Style/PredicateName: Style/PredicateName:
Enabled: false Enabled: false
Style/ClassVars: Style/ClassVars:

View file

@ -602,7 +602,7 @@ returns
end end
def self.symbolize_keys(hash) def self.symbolize_keys(hash)
hash.inject({}) {|result, (key, value)| hash.each_with_object({}) {|(key, value), result|
new_key = case key new_key = case key
when String then key.to_sym when String then key.to_sym
else key else key
@ -612,7 +612,6 @@ returns
else value else value
end end
result[new_key] = new_value result[new_key] = new_value
result
} }
end end