Skip to content

Instantly share code, notes, and snippets.

@jjuarez
Created September 26, 2013 10:59
Show Gist options
  • Save jjuarez/6712672 to your computer and use it in GitHub Desktop.
Save jjuarez/6712672 to your computer and use it in GitHub Desktop.
def translate(settings)
settings.inject({}) do |hash, (key, value)|
case key
when 'foo' then hash[:foo] = value
when 'bar' then hash[:bar] = value.split(%r,/)
end
hash
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment