Browse Source

Corrected with rubocop cop 'Style/EachWithObject'.

Thorsten Eckel 9 years ago
parent
commit
bfa6f11221
2 changed files with 1 additions and 4 deletions
  1. 0 2
      .rubocop.yml
  2. 1 2
      lib/sessions.rb

+ 0 - 2
.rubocop.yml

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

+ 1 - 2
lib/sessions.rb

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