Skip to content

Instantly share code, notes, and snippets.

@homelinen
Created February 2, 2016 15:53
Show Gist options
  • Save homelinen/568b14b6835696ac7f4b to your computer and use it in GitHub Desktop.
Save homelinen/568b14b6835696ac7f4b to your computer and use it in GitHub Desktop.
# Have a default hash that can be merged into an array
# One other requirement is the default should be overridden by the array
default_values = {
username => 'user',
password => 'password'
}
nginx_stats = [
{
stats_path => 'http://nginx-1',
},
{
stats_path => 'http://nginx-2',
}
]
merge_array_of_hashes(nginx_stats, default_values)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment