Ruby类实例变量与实例变量
代码先行
class Kitty @class_ins_1 = 1 attr_accessor :ins_1, :ins_2 def initialize @ins_1 = 11 end class << Kitty attr_accessor :class_ins_1, :class_ins_2 endendputs Kitty.class_ins_1Kitty.class_ins_2 = 2puts Kitty.class_ins_2k = Kitty.newputs k.ins_1k.ins_2 = 22puts k.ins_2