There's more than one way to write the corresponding Ruby snippet. If I had been writing it, I might have translated it something like this: class BlogPost class This avoids needing to understand what `@@count` means, and lets you use the same syntax as in python: `BlogPost.count += 1`. Or, if I were in a codebase using static type annotations with Sorbet, I'd do something like this[0]. To each their own, write code…
That’s without even mentioning the footguns available in @@count Jez!
If you plan to subclass BlogPost, the translation is not identical, as the alternate implementation would not keep track of a global count of posts across all subclasses, only of `BlogPost` instances exactly.