title: Remove explicit reference dependency injection using ruby
body: <p>Can somebody help me with my problem, I'm not familiar with dependency injection.
  I have an exam. Question is: Remove Car's explicit reference to Engine by using dependency injection.</p>
  
  <pre><code>class Car
    attr_reader :engine
  
    def engine
      @engine ||= Engine.new(4)
    end
  
    def move
      engine.accelerate
    end
  end
  
  class Engine
    attr_reader :cylinders
  
    def initialize(cylinders)
      @cylinders = cylinders
    end
  
    def accelerate
  
    end
  end
  </code></pre>
  
  <p>Can somebody help me. Thank you</p>