smtlaissezfaire / mix_master

A pure ruby solution for unmixing modules.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

MixMaster

A pure ruby solution for mixing & unmix modules from classes.

module Foo
  def foo
    'foo'
  end
end

class Baz
  mixin Foo
end

b = Baz.new
=> #<Baz:0x6aa48c>
b.foo
=> "foo"

Baz.mixout Foo
=> [Foo]

Baz.new.foo
NoMethodError: undefined method `foo' for #<Baz:0x69a640>
	from (irb):30
b.foo
NoMethodError: undefined method `foo' for #<Baz:0x6aa48c>
	from (irb):31

Inspiration

Both _why’s and Dan Manges’ libraries (mixico and mixology) have been of great inspiration.

About

A pure ruby solution for unmixing modules.

License:GNU General Public License v3.0


Languages

Language:Ruby 100.0%