lib/read_time.rb in read_time-1.0.5 vs lib/read_time.rb in read_time-1.0.6

- old
+ new

@@ -1,36 +1,36 @@ require "read_time/version" module ReadTime module String - @@output = "" + @output = "" def seconds_to_read - (self.split(" ").count/3.3333333333).to_i + (self.split(" ").count / 3.3333333333).to_i end def minutes_to_read(secs) if secs / 60 > 1 - @@output << "#{secs / 60} minutes " + @output << "#{secs / 60} minutes " else - @@output << "1 minute " + @output << "1 minute " end if secs % 60 > 0 if secs % 60 > 1 - @@output << "#{secs % 60} seconds" + @output << "#{secs % 60} seconds" else - @@output << "1 second" + @output << "1 second" end end end def hours_to_read(secs) if secs / 3600 > 1 - @@output << "#{secs / 3600} hours " + @output << "#{secs / 3600} hours " else - @@output << "1 hour " + @output << "1 hour " end if secs % 3600 > 0 minutes_to_read(secs % 3600) end @@ -45,10 +45,10 @@ if seconds_to_read > 3600 hours_to_read(seconds_to_read) else minutes_to_read(seconds_to_read) end - puts @@output + puts @output end end end end