Do you really know public, private and protected in Ruby?

Public, private and protected access - all of the programmers are familiar with that concept. Nothing special, we work with them on a daily basis. However, as Ruby programmers, do we really know the details?You can check yourself with these five statements. Try to answer: TRUE or FALSE.Statements:Public methods have no access control - they can be called from the outside of the class definition by the instance of that class or it’s subclasses.Both protected and private methods cannot be called from the outside of the defining class.Protected methods are accessible from the subclass and private methods are not.Private methods of the defining class can be invoked by any instance of that class.Public access is the default one.
Do you really know public, private and protected in Ruby? #ruby #rubydeveloper #rubyonrails https://rubyonrails.ba/single/do-you-really-know-public-private-and-protected-in-ruby

Nezir Zahirovic

Contractor Ruby On Rails (8+ years) / MCPD .Net / C# / Asp.Net / CSS / SQL / (11 years)

related articles