module-mixy

Module.mixy is an imitation of Module.mix.

Build Status Gem Version Dependency Status

Features

  • Pure Ruby :)

Usage

Overview

require 'module/mixy'

module Foo
  def common
    'FOO :)'
  end
end

module Bar
  def common
    'bar :('
  end
end

class FooBar
  extend Module::Mixy
  mixy Foo, :common => :foo_common
  mixy Bar, :common => :bar_common
end

foobar = FooBar.new
p foobar.methods.grep(/common/) #=> [:bar_common, :foo_common]
p foobar.foo_common             #=> "FOO :)"
p foobar.bar_common             #=> "bar :("

Be anywhere

require 'module/mixy/core_ext'

Requirements

Install

$ gem install module-mixy

Link

License

The MIT X11 License
Copyright (c) 2012 Kenichi Kamiya
See MIT-LICENSE for further details.