title: if-else and method calls inside Ruby class initialize method
body: <p>My code actually works, but I'm not sure if it's the proper way to do it. It's purpose is to allow modifying certain file only once a day. There's a lots of code, but it roughly looks something like this:</p>
  
  <pre><code>class Something
    def initialize
      if file_modified_today
        load_file
        #it loads variables from a file
      else
        @aaa = rand(1..30)
        # ... lots of other variable assignments
      end 
    end
    def file_modified_today
      #returns true or false
    end
    def load_file
      #reads and loads variables from a file
    end
  end
  </code></pre>
  
  <p>I hope my code is not confusing. My question is, is this way of initializing class wrong? I could probably think of a way to remove if-else and method call from initialize, maybe define class method, and use it before creating instance</p>