Skip to content

Instantly share code, notes, and snippets.

@morhekil
Created October 14, 2013 10:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save morhekil/6973666 to your computer and use it in GitHub Desktop.
Save morhekil/6973666 to your computer and use it in GitHub Desktop.
#!/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