Created
October 14, 2013 10:20
-
-
Save morhekil/6973666 to your computer and use it in GitHub Desktop.
This file contains 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
#!/usr/bin/env ruby | |
module ClassMixin | |
def ping | |
puts 'pong' | |
end | |
end | |
module InstanceMixin | |
def blip | |
puts 'blop' | |
end | |
end | |
class Minion | |
end | |
Minion.class_exec do | |
include ClassMixin | |
end | |
the_minion = Minion.new | |
the_minion.ping | |
the_minion.extend InstanceMixin | |
the_minion.blip |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment