I need to create an object with my own custom method in ruby instead of default new().
obj = User.new
If I need to create an object for a user with generate(), how this can be achieved. So when I type
obj = User.generate
it should create an object of User.
One way I understand is by aliasing the method with alias keyword.
Though I am not sure.
Is there any suggestion for doing it.??