Define a constant
suggest changeMY_CONSTANT = "Hello, world" # constant
Constant = 'This is also constant' # constant
my_variable = "Hello, venus" # not constatn
Constant name start with capital letter. Everything that start with capital letter are considered as constant in Ruby. So class and module are also constant. Best practice is use all capital letter for declaring constant.
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents