Skip to content

Instantly share code, notes, and snippets.

@alexjfisher
Created September 24, 2016 10:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save alexjfisher/4cad33baccd97c17fb43062eb35d30f7 to your computer and use it in GitHub Desktop.
Save alexjfisher/4cad33baccd97c17fb43062eb35d30f7 to your computer and use it in GitHub Desktop.
return hash.reduce({}) do |acc, kv|
acc[id + kv[0]] = { 'key' => kv[0], 'value' => kv[1] }
acc
end
@alexjfisher
Copy link
Author

Offenses:

lib/puppet/parser/functions/to_hash_settings.rb:33:17: C: Style/EachWithObject: Use each_with_object instead of reduce.
    return hash.reduce({}) do |acc, kv|
                ^^^^^^

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment