Skip to content
This repository has been archived by the owner on May 22, 2021. It is now read-only.

kachick/module-mixy

Repository files navigation

module-mixy

  • This repository is archived
  • No longer maintained
  • All versions have been yanked from https://rubygems.org for releasing valuable namespace for others

Module.mixy is an imitation of Module.mix.

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

License

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