Skip to content

Instantly share code, notes, and snippets.

@andreareginato
Created July 20, 2012 10:55
Show Gist options
  • Save andreareginato/3150153 to your computer and use it in GitHub Desktop.
Save andreareginato/3150153 to your computer and use it in GitHub Desktop.
Hash guidestyle
# I'm trying to search the 'cleanest' solution to create an hash.
# The different guidestyles I've found around does not satisfy me at all.
# Tell me which ones you like between those options
# solution 1 (favorite at the moment)
let!(:params) do
{ response_type: 'code',
client_id: application.id.to_s,
redirect_uri: application.redirect_uri,
scope: 'public write',
state: 'remember-me' }
end
# solution 2
let!(:params) do
{
response_type: 'code',
client_id: application.id.to_s,
redirect_uri: application.redirect_uri,
scope: 'public write',
state: 'remember-me'
}
end
# solution 3
let!(:params) do
Hash[ response_type: 'code',
client_id: application.id.to_s,
redirect_uri: application.redirect_uri,
scope: 'public write',
state: 'remember-me' ]
end
# solution 4
let!(:params) do
Hash[
response_type: 'code',
client_id: application.id.to_s,
redirect_uri: application.redirect_uri,
scope: 'public write',
state: 'remember-me'
]
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment