read_time 1.1.0 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2c5bfe8cf022337cd20d7b7513299b6a035b0408
4
- data.tar.gz: 7580568986d02930486395bebcc587f07fb154ea
3
+ metadata.gz: 82f314044371b282c264c7049096df3f79b7b0d4
4
+ data.tar.gz: 24a3cd52545e4c3bcaa6a16fe354784232d22817
5
5
  SHA512:
6
- metadata.gz: 1367f073f9e10a26596935d77ec5404ed4428cf7f8b260c08c3f354b4cbb78a98206fb580f5cb9d355d0b7f0e52751f6b3c36633ada66694db4530266824570c
7
- data.tar.gz: 19f43bf717727d7c1c566a51afdb5351d64853977818bb301a336b8c1dced20a0c3390b43c3e1177b795ebf13bbfc2c07c3fe2574e3ed1d7d4aa0ef87a555528
6
+ metadata.gz: 2bd1b36bec470e614331004ff7b02355f5f9af95e5ba5d6de2ae725bf8f2dff1a8ece78bd24187651ebd6afdab575676e85f6bc0eea77dc6670c00b2fa76fe89
7
+ data.tar.gz: 758ccdcd837c6740d18c1d9275317fc56c4a9c9b77925d2e3a40b173cca160ccca5c4bef8270d2a234c05467e9d3a1d1904b55770a453af9e4cf55089ed5d486
data/lib/read_time.rb CHANGED
@@ -4,6 +4,23 @@ module ReadTime
4
4
  module String
5
5
  @output = ""
6
6
 
7
+ def time_to_read
8
+ if seconds_to_read <= 1
9
+ puts "1 second"
10
+ elsif seconds_to_read > 1 && seconds_to_read < 60
11
+ puts "#{seconds_to_read} seconds"
12
+ else
13
+ if seconds_to_read >= 3600
14
+ hours_to_read(seconds_to_read)
15
+ else
16
+ minutes_to_read(seconds_to_read)
17
+ end
18
+ puts @output
19
+ end
20
+ end
21
+
22
+ protected
23
+
7
24
  def seconds_to_read
8
25
  (self.split(" ").count/3.3333333333).to_i
9
26
  end
@@ -38,20 +55,6 @@ module ReadTime
38
55
  end
39
56
  end
40
57
 
41
- def time_to_read
42
- if seconds_to_read <= 1
43
- puts "1 second"
44
- elsif seconds_to_read > 1 && seconds_to_read < 60
45
- puts "#{seconds_to_read} seconds"
46
- else
47
- if seconds_to_read >= 3600
48
- hours_to_read(seconds_to_read)
49
- else
50
- minutes_to_read(seconds_to_read)
51
- end
52
- puts @output
53
- end
54
- end
55
58
  end
56
59
  end
57
60
 
@@ -1,3 +1,3 @@
1
1
  module ReadTime
2
- VERSION = "1.1.0".freeze
2
+ VERSION = "1.1.1".freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: read_time
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kaan Kölköy
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-07-23 00:00:00.000000000 Z
11
+ date: 2017-07-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler