by globuous · 8y ago · 0 comments
“Attributes” in Ruby are just methods that do attribute-like things, so there is no ambiguity: it is always a method.
When used correctly you can write IMHO really clean and concise OOP code where (cascading) changes are easily made.
something = [ alpha beta, gamma ]
I have no idea if I just invoked alpha(beta, gamma) and put the result into a single-member array, or if I've got an array with two elements - alpha(beta) and gamma.As far as I understand, Ruby style is writing the code in the most elegant way to increase readability and (hopefully) reduce chances of bugs.