Today we will talk about dependency injection.
We all know that tighly coupled code is bad and code smells.
So, dependency injection helps us avoid such problems.
Let me give you an example of the following code. class Car
attr_reader :mileage
def initialize(mileage)
mileage = mileage
end def…