Define a constant

suggest change
MY_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.

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents