hms 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -31,6 +31,13 @@ module HMS
31
31
  @seconds
32
32
  end
33
33
 
34
+ #
35
+ # returns the total duration in seconds
36
+ #
37
+ def to_f
38
+ @seconds.to_f
39
+ end
40
+
34
41
  #
35
42
  # returns the hours part of the total duration
36
43
  #
@@ -1,3 +1,3 @@
1
1
  module HMS
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
@@ -280,6 +280,10 @@ class TestDuration < MiniTest::Unit::TestCase
280
280
  assert_operator(81, :**, 3, 4)
281
281
  end
282
282
 
283
+ def test_coerce_float
284
+ assert_equal(12, Math.sqrt(Duration.new(144)))
285
+ end
286
+
283
287
  private
284
288
 
285
289
  def assert_construction(str, int)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hms
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: