Skip to content

Instantly share code, notes, and snippets.

@robb1e
Created September 5, 2012 03:40
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 robb1e/3629987 to your computer and use it in GitHub Desktop.
Save robb1e/3629987 to your computer and use it in GitHub Desktop.
Include and Extend Ruby mixin
module Foo
def say
'foo'
end
end
module Bar
def say
'bar'
end
end
class Baz
include Foo
end
baz = Baz.new
puts baz.say
bazzer = Baz.new
bazzer.extend(Bar)
puts bazzer.say
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment