jobwat
5/2/2014 - 7:03 AM

Constant lookup limitation in Ruby

Constant lookup limitation in Ruby

⚡ ruby CONSTANT.rb
CONSTANT.rb:3:in `showConstant': uninitialized constant Foo::CONSTANT (NameError)
	from CONSTANT.rb:10:in `<main>'
class Foo
  def self.showConstant
    puts CONSTANT
  end
end
class SubFoo < Foo
  CONSTANT='SubFoo string'
end

SubFoo.showConstant