class Abc attr_accessor :a, :b def self.new(a, b) @a = a @b = b end end o = Abc.new("a", "b") # Find output o.a o.b