mardi 7 novembre 2017

Best way to define Constants in Ruby/ RoR at one place

I have multiple classes (4-5) using same constant value, say PI = 3.14. What is the best way to define that constant at one place in Ruby and in RoR application?

Do I construct one module with given Constant and include in all the classes that are using it?

What are best practices and standard Ruby way?

Aucun commentaire:

Enregistrer un commentaire