Skip to content

Commit

Permalink
Fix rubocop Style/EachWithObject
Browse files Browse the repository at this point in the history
Thanks to elomatreb on #ruby IRC

Signed-off-by: Alexander Fisher <[email protected]>
  • Loading branch information
alexjfisher committed Sep 24, 2016
1 parent 4f1fd3f commit 3f6cef9
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/puppet/parser/functions/to_hash_settings.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,8 @@ module Puppet::Parser::Functions

raise(Puppet::ParseError, 'to_hash_settings(): Requires hash to work with') unless hash.is_a?(Hash)

return hash.reduce({}) do |acc, kv|
return hash.each_with_object({}) do |kv, acc|
acc[id + kv[0]] = { 'key' => kv[0], 'value' => kv[1] }
acc
end
end
end

0 comments on commit 3f6cef9

Please sign in to comment.