motion-duration 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4cbcecf706355f4e25da91d2fb26273343e0dc5c
4
- data.tar.gz: 5c27161964749bbcc3ddfd0a036ad8fb11e47a53
3
+ metadata.gz: 1ab552b91287438da36ae513317d30f84b04592c
4
+ data.tar.gz: 3b2bc8229cea43a62411c6fb8c1f99da7da07e86
5
5
  SHA512:
6
- metadata.gz: bcc4a70e1b9a18e8df7b374121a4d2fae377bdd20e265d381db0f202f67abd098f3a884c4f1e4987327cf30e497175b23f579b3f9c449464d9d5e353cda7a6ce
7
- data.tar.gz: ee785e180abdd260d40080b06f41971d04794d087dc47b3881e5bf3dc34d33eb3e89654223e50a905dea1fa3876e2b9fe90266fb9105b29aea2d478d489f047a
6
+ metadata.gz: 5cb19db88620c41703ef3f38f55941e41ec62f37a29ccf6a7d198b5b0c6b731495d2f5264c6e0bb91b79439e2edfabb829bc14675e82f771e4cd5058ba909c70
7
+ data.tar.gz: a4cfb631cc73e1043b4723d74a498d8658cb31c2ed7b643a1539a24233528cf51144f73d084132db6ee643559f8965376f0297dfb02607c9285c784452750408
@@ -63,10 +63,28 @@ class Motion
63
63
  Duration.new(@total % other.to_i)
64
64
  end
65
65
 
66
- %w(minutes hours days).each do |meth|
67
- define_method("total_#{meth}") { @total / MULTIPLES[meth.to_sym] }
66
+ ####################
67
+ # if/when Android ever gets define_method, we can restore this logic and dump
68
+ # the following 3 methods
69
+ # http://hipbyte.myjetbrains.com/youtrack/issue/RM-806
70
+ #%w(minutes hours days).each do |meth|
71
+ # define_method("total_#{meth}") { @total / MULTIPLES[meth.to_sym] }
72
+ #end
73
+
74
+ def total_minutes
75
+ @total / MULTIPLES[:minutes]
68
76
  end
69
77
 
78
+ def total_hours
79
+ @total / MULTIPLES[:hours]
80
+ end
81
+
82
+ def total_days
83
+ @total / MULTIPLES[:days]
84
+ end
85
+
86
+ ####################
87
+
70
88
  # @return true if total is 0
71
89
  def blank?
72
90
  @total == 0
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: motion-duration
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mark Rickert
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-01-02 00:00:00.000000000 Z
11
+ date: 2015-06-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake