Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save ELLIOTTCABLE/14346 to your computer and use it in GitHub Desktop.
Save ELLIOTTCABLE/14346 to your computer and use it in GitHub Desktop.
one-line if/elses never sat well with me
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