Ruby's private keyword is weird – Jake Zimmerman

17-Feb-2023 863
Ruby’s private keyword means something different compared to basically all other object-oriented languages. Most other languages don’t even have a feature matching what Ruby calls private, but incredibly, Scala does, which it calls protected[this] (meaning “object-protected”, as opposed to the normal protected keyword which is called “class-protected”).First let’s review what private normally means, and then discuss what private in Ruby means (which will also amount to an explanation of what protected[this] means in Scala).
Use coupon code:

RUBYONRAILS

to get 30% discount on our bundle!
Prepare for your next tech interview with our comprehensive collection of programming interview guides. Covering JavaScript, Ruby on Rails, React, and Python, these highly-rated books offer thousands of essential questions and answers to boost your interview success. Buy our 'Ultimate Job Interview Preparation eBook Bundle' featuring 2200+ questions across multiple languages. Ultimate Job Interview Preparation eBook Bundle