I have a class Test which is in lib folder and I want to make an object of this class dynamically inside a method of my controller class name class UsersController < ApplicationController. How can I do this?
something like
class UsersController < ApplicationController
def address
{"here I want to create the object of Test class"}
end
end
In Ruby you can’t create object like in C++, you can create only dynamic object with
Object::newmethod. So to create instance ofTestclass you simple wrote: