Prefer getter methods over instance variables inside Ruby objects
Use Ruby getter methods over instance variables for clearer errors and easier debugging
Apr 25, 20259 min read2.1K

Search for a command to run...
Articles tagged with #design-patterns
Use Ruby getter methods over instance variables for clearer errors and easier debugging

#small #methods #code #design #ruby
How to think about design principles and what to do to improve your skills in this area

Context You need to design some routes with the following properties: you need to do some computation in the backend they are idempotent: every time you call the route with the same params it should give you the same result and nothing should change...