title: wrong number of arguments (1 for 0) in bicycle gear calculator
body: <p>I'm reading the book "Practical Object-Oriented Design in Ruby" and I have code that is supposed to calculate the optimal gear on a bicycle given its parameters. The book keeps showing the code being set up in many different ways, but never completely. So, in this case, I am given the <code>initialize</code> part of the <code>Gear</code> class and <code>Gear.new(...</code> part at the end. I'm trying to fill in the remaining parts </p>
  
  <pre><code>class Gear
  
    attr_reader :chaingring, :cog, :wheel
  
    def initialize
      @chainring = args.fetch(:chainring, 40)
      @cog       = args.fetch(:cog, 18)
      @wheel     = args[:wheel]
    end
  
    def gear_inches
      ratio * diameter
    end
  
    def ratio
      chainring / cog.to_f
    end
  
    def wheel
      @wheel ||= Wheel.new(rim, tire)
    end
  
  end
  
  class Wheel
  
    attr_reader :rim, :tire
  
    def initialize(rim, tire)
      @rim = rim
      @tire = tire
    end
  
    def diameter
      rim + (tire * 2)
    end
  
  end
  
  Gear.new(
    :chainring =&gt; 52,
    :cog       =&gt; 11,
    :wheel     =&gt; Wheel.new(26, 2)).gear_inches
  </code></pre>
  
  <p>First of all, it keeps throwing the <code>wrong number of arguments (1 for 0)</code> error for the last line. Second, I feel like there are other flaws here as well. Such as the user of <code>diameter</code> for <code>gear_inches</code> method while they belong to different classes. </p>