Mark some constants as nodoc and remove unneeded namespace

This commit is contained in:
Rafael Mendonça França 2015-03-20 18:11:24 -03:00
parent c35ebe17d8
commit 7c7d9dcf5a
2 changed files with 10 additions and 12 deletions

@ -1,5 +1,5 @@
module ActiveSupport module ActiveSupport
module MarshalWithAutoloading module MarshalWithAutoloading # :nodoc:
def load(source) def load(source)
super(source) super(source)
rescue ArgumentError, NameError => exc rescue ArgumentError, NameError => exc

@ -27,23 +27,21 @@
# should give exactly the same results with or without active support. # should give exactly the same results with or without active support.
module ActiveSupport module ActiveSupport
module CoreExt module ToJsonWithActiveSupportEncoder # :nodoc:
module ToJsonWithActiveSupportEncoder def to_json(options = nil)
def to_json(options = nil) if options.is_a?(::JSON::State)
if options.is_a?(::JSON::State) # Called from JSON.{generate,dump}, forward it to JSON gem's to_json
# Called from JSON.{generate,dump}, forward it to JSON gem's to_json super(options)
super(options) else
else # to_json is being invoked directly, use ActiveSupport's encoder
# to_json is being invoked directly, use ActiveSupport's encoder ActiveSupport::JSON.encode(self, options)
ActiveSupport::JSON.encode(self, options)
end
end end
end end
end end
end end
[Object, Array, FalseClass, Float, Hash, Integer, NilClass, String, TrueClass, Enumerable].reverse_each do |klass| [Object, Array, FalseClass, Float, Hash, Integer, NilClass, String, TrueClass, Enumerable].reverse_each do |klass|
klass.prepend(ActiveSupport::CoreExt::ToJsonWithActiveSupportEncoder) klass.prepend(ActiveSupport::ToJsonWithActiveSupportEncoder)
end end
class Object class Object