Skip to content

Instantly share code, notes, and snippets.

@ys
Created August 23, 2012 11:11
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 ys/3435654 to your computer and use it in GitHub Desktop.
Save ys/3435654 to your computer and use it in GitHub Desktop.
How would you align these kind of things in Ruby?
local_var.method_with_hash_and_block(mandatory_param,
option_1: a,
option_2: blabla,
option_3: blablablablablabla,
option_4: bblablablablablablablabla,
option_5: bblablablabla,
) do |v|
d = v.bla
e = v.bla
end
local_var.method_with_hash_and_block(
mandatory_param,
option_1: a,
option_2: blabla,
option_3: blablablablablabla,
option_4: bblablablablablablablabla,
option_5: bblablablabla,
) do |v|
d = v.bla
e = v.bla
end
@aeris
Copy link

aeris commented Aug 23, 2012

@simonc
Copy link

simonc commented Aug 23, 2012

I'd prefer a more readable approach. Sorry it's not a one-liner anymore ^^
https://gist.github.com/3436157

@ys
Copy link
Author

ys commented Aug 23, 2012

@simonc, I love your approach! @aeris made the same as you at first:)

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