hour 0.2.0 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/hour.rb +2 -1
  3. data/lib/hour/version.rb +1 -1
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 91b0152711820c46e57ddb8107ab885c7921f19e
4
- data.tar.gz: ae4d3d2efaf9a738e01df44f0695e1dddb88cef7
3
+ metadata.gz: 553698ff721afd84b24cc90c5c829e309227259c
4
+ data.tar.gz: e655e4ddf2e4f79e627fab5b392b13b1f43fe27d
5
5
  SHA512:
6
- metadata.gz: 47c38b819df5ee82bd2bb2e4c76ac612fc908df7b4797cc82433c5f694dbd941771e101f28b8012816edddc008b000aacf165aaf5cb3016a991b8139a202c282
7
- data.tar.gz: 02d1bd54e9590e794ddd16d751b541ee8740e31dda7d0f7f863ad55d5e1e67f141f6269530112abb3c0c71c05e1443313cae273cfd8044aeff143ce8aa9c2a78
6
+ metadata.gz: 41ce340d977fdcd7a28ef10c633e63cdb9bfa285081e501e0c06bb279a9e55736040e5368333c2d80d936e0a7a2c7bdf1cf3d015d131130c40c4644a2658e084
7
+ data.tar.gz: 023e742e832fd8ed7c1fc4c09ee7fe6dff3abc0ef59770151dd2c76ce72b150f942778b17d28f3d53ceea4e82d3ce2031281e596c6efc0a6fbb65e75b741b7d7
@@ -2,11 +2,12 @@
2
2
 
3
3
  module Hour
4
4
  class Hour
5
- attr_reader :hours, :minutes, :to_seconds, :days, :hours_less_days, :to_s, :to_formatted_s, :to_a, :to_time
5
+ attr_reader :hours, :minutes, :to_seconds, :days, :hours_less_days, :to_s, :to_formatted_s, :to_a, :to_time, :minutes_in_base10
6
6
 
7
7
  def initialize(hours, minutes = 0)
8
8
  hours, minutes = hours.split(':') if hours.is_a? String
9
9
  @minutes = [0, minutes.to_i, 59].sort[1] # Constrains assignment to the middle value, w/o the #Clamp method
10
+ @minutes_in_base10 = @minutes.to_f / 60
10
11
  @to_a = [@hours = hours.to_i, @minutes]
11
12
  @to_s = "#{'%02d' % @hours}:#{'%02d' % @minutes}" # Formats single-digits such that '1' will be '01'
12
13
  @to_seconds = (@hours * 60 + @minutes) * 60
@@ -1,3 +1,3 @@
1
1
  module Hour
2
- VERSION = "0.2.0"
2
+ VERSION = "0.3.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hour
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - davegregg