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).
Ruby's private keyword is weird – Jake Zimmerman #ruby #rubydeveloper #rubyonrails #Ruby's #private #keyword #weird #Zimmerman https://rubyonrails.ba/link/ruby-s-private-keyword-is-weird-jake-zimmerman