(pry):39: warning: already initialized constant A (pry):38: warning: previous definition of A was here => 6 pry(main)> Class = 3 (pry):40: warning: already initialized constant Class => 3 pry(main)> Class => 3
but then the parent changes it class Bad def self.corrupt_registry! @@registry = [] end end class BadChild < Bad @@registry = {} # This is some variable which meant to belong to THIS class def self.registry @@registry end end Bad.corrupt_registry! # Probably unexpected for BadChild's author, its ancestor have changed the variable BadChild.registry # On the next attempt to _access_ the variable the error will be raised # 2.7: => [] # 3.0: RuntimeError (class variable @@registry of BadChild is overtaken by Bad) Ruby 3.0 changes
"One Ring to find them,\n" + # "One Ring to bring them all,\n" + # "and in the darkness bind them,\n" + # "In the Land of Mordor where the Shadows lie.\n"
"One Ring to find them,\n" + # "One Ring to bring them all,\n" + # "and in the darkness bind them,\n" + # "In the Land of \#{land} where the Shadows lie.\n"
an inner heredoc: #{<<-INNER} This is the inner heredoc. It is nested within the outer heredoc. It can contain its own multi-line text. INNER The outer heredoc continues here. OUTER