Skip to content

Instantly share code, notes, and snippets.

@Ebtoulson
Created March 21, 2014 14:30
Show Gist options
  • Save Ebtoulson/9687506 to your computer and use it in GitHub Desktop.
Save Ebtoulson/9687506 to your computer and use it in GitHub Desktop.
1.9.3-p392 :001 > class Test
1.9.3-p392 :002?> def self.wtf
1.9.3-p392 :003?> "WHAT DA FUCK"
1.9.3-p392 :004?> end
1.9.3-p392 :005?>
1.9.3-p392 :006 > self.singleton_class.send(:alias_method, :wtf_mate, :wtf)
1.9.3-p392 :007?> end
=> #<Class:Test>
1.9.3-p392 :008 > Test.wtf
=> "WHAT DA FUCK"
1.9.3-p392 :009 > Test.wtf_mate
=> "WHAT DA FUCK"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment