Skip to content

smtlaissezfaire/mix_master

Repository files navigation

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.

Resources

License

GPL-3.0, MIT licenses found

Licenses found

GPL-3.0
GPL_LICENSE
MIT
MIT_LICENSE

Stars

Watchers

Forks

Packages

No packages published

Languages