Code review comments

Public, Rails Errors, Ruby General


Created: Nov 01, 2019     Updated: Jan 31, 2020

instance variables / getters / setters

re: @redis

In general for getters and setters in our classes. Can we:

  1. limit the usage of instance variables to setters (@redis), i.e. where we are assigning things, and
  2. use an attr_reader with getters (redis) everywhere else where we are getting the value out

This makes it more clear for other devs where things are being used (fetched), versus where things could potentially be getting set (setters) and the value is altered and changing. A change infers you’d have to follow the sequence of events to dial in what the value is/was.

Does that make sense?