easy_time 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/Gemfile.lock +1 -1
- data/lib/easy_time.rb +12 -12
- data/lib/easy_time/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 81e4762bb54961cecadb64214a5a72264145187d621bca1ed38175c4c73c1efe
|
4
|
+
data.tar.gz: d78614033f17422a6e8fad9a3127aec448e442f755f26e2587df0e22505d91d4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9f188b204b034fbdfada4745f300e9852b433e1bcb34470d9b68f5a3cd1a3733ffb7df01286039c366669c8efd3e94db2bb80165b39687e2628109f14b19605e
|
7
|
+
data.tar.gz: 1c7d9d47438f6867515a23e9c576d8679e16ff04073ac27688655ed6ea7e6dfea959473d783e745f150cb6724ed2a44923f20f14619373c1373cba8e81c3119b
|
data/Gemfile.lock
CHANGED
data/lib/easy_time.rb
CHANGED
@@ -212,17 +212,17 @@ class EasyTime
|
|
212
212
|
new(parse_string(time_string))
|
213
213
|
end
|
214
214
|
|
215
|
-
def method_missing(
|
216
|
-
if Time.respond_to?(
|
217
|
-
value = Time.send(
|
215
|
+
def method_missing(symbol, *args, &block)
|
216
|
+
if Time.respond_to?(symbol)
|
217
|
+
value = Time.send(symbol, *args, &block)
|
218
218
|
is_a_time?(value) ? new(value) : value
|
219
219
|
else
|
220
|
-
super
|
220
|
+
super(symbol, *args, &block)
|
221
221
|
end
|
222
222
|
end
|
223
223
|
|
224
|
-
def respond_to_missing?(
|
225
|
-
Time.respond_to?(
|
224
|
+
def respond_to_missing?(symbol, include_all=false)
|
225
|
+
Time.respond_to?(symbol, include_all)
|
226
226
|
end
|
227
227
|
|
228
228
|
# @param value [Anything] value to test as a time-like object
|
@@ -381,17 +381,17 @@ class EasyTime
|
|
381
381
|
end
|
382
382
|
|
383
383
|
# intercept any time methods so they can wrap the time-like result in a new EasyTime object.
|
384
|
-
def method_missing(
|
385
|
-
if time.respond_to?(
|
386
|
-
value = time.send(
|
384
|
+
def method_missing(symbol, *args, &block)
|
385
|
+
if time.respond_to?(symbol)
|
386
|
+
value = time.send(symbol, *args, &block)
|
387
387
|
is_a_time?(value) ? dup.tap { |eztime| eztime.time = value } : value
|
388
388
|
else
|
389
|
-
super
|
389
|
+
super(symbol, *args, &block)
|
390
390
|
end
|
391
391
|
end
|
392
392
|
|
393
|
-
def respond_to_missing?(
|
394
|
-
time.respond_to?(
|
393
|
+
def respond_to_missing?(symbol, include_all=false)
|
394
|
+
time.respond_to?(symbol, include_all)
|
395
395
|
end
|
396
396
|
|
397
397
|
def is_a_time?(value)
|
data/lib/easy_time/version.rb
CHANGED