def_module(methodname='erb')
Instance Public methods
Create unnamed module, define methodname as instance method of it, and return it.
example:
filename = 'example.rhtml' # 'arg1' and 'arg2' are used in example.rhtml erb = ERB.new(File.read(filename)) erb.filename = filename MyModule = erb.def_module('render(arg1, arg2)') class MyClass include MyModule end
Please login to continue.