Skip to content

Instantly share code, notes, and snippets.

@avdi
Created February 18, 2015 03:01
Show Gist options
  • Save avdi/2c2f919714330d21ed38 to your computer and use it in GitHub Desktop.
Save avdi/2c2f919714330d21ed38 to your computer and use it in GitHub Desktop.
Short methods, long names
RUBY_VERSION # => "2.1.5"
m = define_method %^
puts "The coding standard says 'long methods are bad'."
puts "Stupid coding standards. What do they know?"
puts "It says long method names are OK though."
puts "Suckers!"
^ do
eval(__callee__.to_s)
end
send m
# >> The coding standard says 'long methods are bad'.
# >> Stupid coding standards. What do they know?
# >> It says long method names are OK though.
# >> Suckers!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment