Skip to content
This repository

Paramix for Parametric Mixins

Parametric Mixins makes it easy to parameterize mixin modules.

Resources

Example

 module MyMixin
   include Paramix::Parametric

   parameterized do |params|
     define_method :params do
       params
     end
   end

   def hello
     puts "Hello from #{params[:name]}!"
   end
 end

 class MyClass
   include MyMixin[:name => 'Ruby']
 end

 m = MyClass.new
 m.hello   #=> 'Hello from Ruby!'
Something went wrong with that request. Please try again.