You don't need the intermediate variable

class Time
  def self.yesterday
     now - 86400
  end
end

Time.yesterday works just fine :)