ozone 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ozone/version.rb +1 -1
- data/lib/ozone.rb +15 -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: 0c585fbf22c931b863f9fddcdf007c5ae2fc4f92
|
4
|
+
data.tar.gz: fe8603a322ab57aa36896ee45a5575bebee510b0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9ee36d054417a3cbc4f9a79e3b746d64739933bdb6c3b36fd8e592f2572c01ec20162bba2513acacb5f75ce89833d973cfe20d24affca7598af9f4450395c826
|
7
|
+
data.tar.gz: b205d566b1da27dcb1bc3df74511af671bee64c63e174371f1e0f5be64b1ef6e2c123e54a65d973810bee9454752a26be0339216fa51734cacc32ccd69a440de
|
data/lib/ozone/version.rb
CHANGED
data/lib/ozone.rb
CHANGED
@@ -36,18 +36,32 @@ module Ozone
|
|
36
36
|
@time = time
|
37
37
|
end
|
38
38
|
|
39
|
+
def <=> (time_with_zone)
|
40
|
+
if after?(time_with_zone)
|
41
|
+
1
|
42
|
+
elsif before?(time_with_zone)
|
43
|
+
-1
|
44
|
+
else
|
45
|
+
0
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
39
49
|
def before?(time_with_zone)
|
40
50
|
adjusted_time < time_with_zone
|
41
51
|
end
|
42
52
|
|
43
53
|
def after?(time_with_zone)
|
44
|
-
|
54
|
+
adjusted_time > time_with_zone
|
45
55
|
end
|
46
56
|
|
47
57
|
def strftime(format: '%Y-%m-%d %H:%M')
|
48
58
|
Formatter.call(time: @time, offset: @offset, observes_dst: @observes_dst, format: format)
|
49
59
|
end
|
50
60
|
|
61
|
+
alias_method :<, :before?
|
62
|
+
alias_method :>, :after?
|
63
|
+
alias_method :to_s, :strftime
|
64
|
+
|
51
65
|
private
|
52
66
|
|
53
67
|
def adjusted_time
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ozone
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Hubert Huang
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-08-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|