>>854

class Foo
  def self.[](a)
    new(a)
  end
end

foo = Foo[0]
p foo.class #=> Foo