DEV Community

Discussion on: Getting Oriented with Objects in Ruby

Collapse
 
w3ndo profile image
Patrick Wendo

I loved this post. Educational as always. However, if I may add a minor tangent with regards to the class diagrams.

We want to also show the visibility of the attributes and the methods. So in your example, we would have append a +, - or # depending on whether the attribute/methods is public, private or protected respectively.

+name => name is a public attribute
-age => age is a private attribute
#make_sound() => make_sound is a protected method
Enter fullscreen mode Exit fullscreen mode

This typically helps the transition from design to implementation easier.