time-interval 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/time_interval/time_pair.rb +8 -0
- data/lib/time_interval/time_with_duration.rb +8 -0
- data/lib/time_interval/version.rb +1 -1
- 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: 19332affedd3c797819348596303bb4acf65afe1
|
4
|
+
data.tar.gz: de62b70cbd528c98562a9ec1acbef56663d3c925
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 76f88a28295ac79cd0e3e03934b26b432e1084a8b349a238ca7e51d710e0d5b190476f9eb0a4af0b9371ad85e7273c8d0c9dc9482ad7ecc392328804e5ecfdac
|
7
|
+
data.tar.gz: 087bde9f32c01632a48a792391500ff8b7d981d9c946eea5b68f44049775b3874d4054913a6bca33c058736fb591d94d929ded0f58b219653b4d3dfd264f27e6
|
@@ -18,6 +18,14 @@ module TimeInterval
|
|
18
18
|
@end_time = end_time
|
19
19
|
end
|
20
20
|
|
21
|
+
def ==(other)
|
22
|
+
return false unless other.is_a? TimePair
|
23
|
+
|
24
|
+
start_time == other.start_time && end_time == other.end_time
|
25
|
+
end
|
26
|
+
|
27
|
+
alias_method :eql?, :==
|
28
|
+
|
21
29
|
def iso8601
|
22
30
|
"#{start_time.iso8601}/#{end_time.iso8601}"
|
23
31
|
end
|
@@ -31,6 +31,14 @@ module TimeInterval
|
|
31
31
|
@forwards = forwards
|
32
32
|
end
|
33
33
|
|
34
|
+
def ==(other)
|
35
|
+
return false unless other.is_a? TimeWithDuration
|
36
|
+
|
37
|
+
start_time == other.start_time && end_time == other.end_time
|
38
|
+
end
|
39
|
+
|
40
|
+
alias_method :eql?, :==
|
41
|
+
|
34
42
|
def end_time
|
35
43
|
if forwards?
|
36
44
|
duration.add_to start_time
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: time-interval
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sebastian Edwards
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-02-
|
11
|
+
date: 2015-02-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|