summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorFlorian Frank <flori@ping.de>2011-11-22 10:23:04 +0100
committerFlorian Frank <flori@ping.de>2011-11-22 10:23:04 +0100
commit504e6d464d7eb3b153f5e107698588f135de8511 (patch)
tree9b7c4852b62c1131a9582f6667ca5454b45e75a9 /lib
parent8828e9cd225ac0591b3a5015a53cb91b7232bd83 (diff)
parenta04856d8ea1bc5e98e9a8ef299dffd6bee365fc1 (diff)
downloadjson-504e6d464d7eb3b153f5e107698588f135de8511.tar.gz
Merge branch 'master' of https://github.com/jpartlow/json into jpartlow-master
Diffstat (limited to 'lib')
-rw-r--r--lib/json/add/time.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/json/add/time.rb b/lib/json/add/time.rb
index abc807a..9755707 100644
--- a/lib/json/add/time.rb
+++ b/lib/json/add/time.rb
@@ -10,8 +10,8 @@ class Time
if usec = object.delete('u') # used to be tv_usec -> tv_nsec
object['n'] = usec * 1000
end
- if respond_to?(:tv_nsec)
- at(*object.values_at('s', 'n'))
+ if instance_methods.include?(:tv_nsec)
+ at(object['s'], Rational(object['n'], 1000))
else
at(object['s'], object['n'] / 1000)
end