summaryrefslogtreecommitdiff
path: root/lib/json/add/time.rb
diff options
context:
space:
mode:
authorFlorian Frank <flori@ping.de>2011-12-21 11:05:46 +0100
committerFlorian Frank <flori@ping.de>2011-12-21 11:05:46 +0100
commit60ef7adb347b473cbcce9aacacb2943ae5fb4d4c (patch)
treeba73bea0660d74b2a9a787c5e0acd1a06739e1b6 /lib/json/add/time.rb
parent0dacb54bcdf3c40cc38dae26f04b780024460b45 (diff)
parent59ecfad89281873fe72234b62545294b5fa7ba95 (diff)
downloadjson-60ef7adb347b473cbcce9aacacb2943ae5fb4d4c.tar.gz
Merge branch 'master' of https://github.com/MagLev/json into MagLev-masterMagLev-master
Diffstat (limited to 'lib/json/add/time.rb')
-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