a gem that allows objects to effectively mixin and unmix modules
gem install mixology
require "mixology"
mixin = Module.new { def foo; "foo from mixin"; end }
object = Class.new { def foo; "foo from object"; end }.new
object.mixin mixin
object.foo #=> "foo from mixin"
object.unmix mixin
object.foo #=> "foo from object"
that's pretty much it. for other examples, take a look at the tests.
- MRI 1.8.x, 1.9.x
- JRuby 1.1.x
- Patrick Farley
- anonymous z
- Dan Manges
- Clint Bishop
- Banister Fiend
- Tianyi Cui
hosted on github
released under Ruby's license