How to create our own class and how to access that

For Rails, you can create your own custom classes and put them in lib folder. from lib you can automatically access your classes in controllers