google-api-ruby-client/lib/compat/multi_json.rb

20 lines
404 B
Ruby
Raw Normal View History

2012-08-30 09:15:59 +00:00
require 'multi_json'
2012-10-11 00:23:53 +00:00
if !MultiJson.respond_to?(:load) || [
2012-10-13 06:43:52 +00:00
Kernel,
2012-10-11 00:23:53 +00:00
defined?(ActiveSupport::Dependencies::Loadable) && ActiveSupport::Dependencies::Loadable
].compact.include?(MultiJson.method(:load).owner)
2012-08-30 09:15:59 +00:00
module MultiJson
class <<self
alias :load :decode
end
end
end
if !MultiJson.respond_to?(:dump)
2012-08-30 09:15:59 +00:00
module MultiJson
class <<self
alias :dump :encode
end
end
end