ruby / ability to share a single variable between multiple classes
问题 For general classes manipulation understanding; given the following use case : class Child1 def process var 'child1' + var end end class Child2 def process var 'child1' + var end end class Child3 def process var 'child3' + var end end ... class Master attr_reader :var def initialize(var) @var = var end def process [ Child1.new.process(var), Child2.new.process(var), Child3.new.process(var) ] end end by some kind of inheritance or structure, would there be a way to have var available to all