Constants cannot be defined in methods
suggest changedef say_hi
MESSAGE = "Hello"
puts MESSAGE
end
The above code results in an error: SyntaxError: dynamic constant assignment. This is the = form inside a method. Module#const_set can still create a constant at runtime.
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents