Ruby Language Constants Constants cannot be defined in methods


Example

def say_hi
  MESSAGE = "Hello"
  puts MESSAGE
end

The above code results in an error: SyntaxError: (irb):2: dynamic constant assignment.