title: What is the cleanest way to calculate instance variables in initialize?
body: <p>Say I have a class that defines a collection of my days and how wacky they are. Is it better to initialize my @scores variable in the initialize function like so:</p>
  
  <pre><code>class WackyDayScorer
    attr_reader :scores
    def initialize(start = Time.now, max = 90.days)
      @start  = start
      @limit  = start - max
      @scores = get_scores
    end
  
  private
    def get_scores
      result = []
      t = @start.clone
      until t &lt; max
        result &lt;&lt; score_wackiness(t)
        t -= 1.day
      end
      result
    end
  end
  </code></pre>
  
  <p>or initialize it in the get_scores method like so:</p>
  
  <pre><code>class WackyDayScorer
    attr_reader :scores
  
    def initialize(start = Time.now, max = 90.days)
      @start = start
      @limit = start - max
      get_scores
    end
  
  private
    def get_scores
      @scores = []
      t = @start.clone
      until t &lt; max
        @scores &lt;&lt; score_wackiness(t)
        t -= 1.day
      end
    end
  end
  </code></pre>