Module: ReadTime::String

Included in:
String
Defined in:
lib/read_time.rb

Instance Method Summary collapse

Instance Method Details

#time_to_readObject



7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/read_time.rb', line 7

def time_to_read
  if seconds_to_read <= 1
    puts "1 second"
  elsif seconds_to_read > 1 && seconds_to_read < 60
    puts "#{seconds_to_read} seconds"
  else
    if seconds_to_read >= 3600
      hours_to_read(seconds_to_read)
    else
      minutes_to_read(seconds_to_read)
    end
    puts @output
  end
end