summaryrefslogtreecommitdiff
path: root/ext/json/lib/json/add/time.rb
diff options
context:
space:
mode:
Diffstat (limited to 'ext/json/lib/json/add/time.rb')
-rw-r--r--ext/json/lib/json/add/time.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/json/lib/json/add/time.rb b/ext/json/lib/json/add/time.rb
index 338209d..d983467 100644
--- a/ext/json/lib/json/add/time.rb
+++ b/ext/json/lib/json/add/time.rb
@@ -10,7 +10,7 @@ class Time
if usec = object.delete('u') # used to be tv_usec -> tv_nsec
object['n'] = usec * 1000
end
- if instance_methods.include?(:tv_nsec)
+ if method_defined?(:tv_nsec)
at(object['s'], Rational(object['n'], 1000))
else
at(object['s'], object['n'] / 1000)