module TestM def do_something(text) define_method('hi') do puts 'hi' + text end end end class BaseTest extend TestM end class Tester < BaseTest do_something('sam') end class Tes < BaseTest do_something 'dsfd' end test = Tester.new coll = Tes.new test.hi coll.hi