Created
October 2, 2008 13:04
-
-
Save ELLIOTTCABLE/14346 to your computer and use it in GitHub Desktop.
one-line if/elses never sat well with me
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if self.singleton? | |
refine_singleton_method meth | |
else | |
refine_instance_method meth | |
end | |
if self.singleton?; refine_singleton_method meth | |
else; refine_instance_method meth | |
end | |
self.singleton? ? refine_singleton_method(meth) : refine_instance_method(meth) | |
if self.singleton? then refine_singleton_method meth else refine_instance_method meth end | |
send "refine_#{self.singleton? ? 'singleton' : 'instance'}_method", meth |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment