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 +4 -4
- data/lib/project/motion-duration.rb +20 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1ab552b91287438da36ae513317d30f84b04592c
|
4
|
+
data.tar.gz: 3b2bc8229cea43a62411c6fb8c1f99da7da07e86
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
67
|
-
|
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.
|
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-
|
11
|
+
date: 2015-06-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|