From: Robert Klemme Date: 2011-05-01T04:40:31+09:00 Subject: Re: Why defining a constant in a method is not allowed but using self.class.const_set is allowed? On 30.04.2011 21:25, Iņaki Baz Castillo wrote: > Hi, assinging a value to a constant within a method is not allowed > (SyntaxError:: dynamic constant assignment) but I can use > self.class.const_set within a method. Which is the difference? You described the difference pretty accurately. It is quite common for Ruby to forbid doing bad things directly while still leaving a way to do it nevertheless (just think of private methods and #send). Kind regards robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/