No documentation

# File activesupport/lib/active_support/json/encoding.rb, line 219def as_json(options=nil)#:nodoc:# create a subset of the hash by applying :only or :exceptsubset=ifoptionsifattrs=options[:only]slice(*Array.wrap(attrs))elsifattrs=options[:except]except(*Array.wrap(attrs))elseselfendelseselfend# use encoder as a proxy to call as_json on all values in the subset, to protect from circular referencesencoder=options&&options[:encoder]||ActiveSupport::JSON::Encoding::Encoder.new(options)pairs=subset.map{|k,v|[k.to_s,encoder.as_json(v)]}result=self.is_a?(ActiveSupport::OrderedHash)?ActiveSupport::OrderedHash.new:Hash.newpairs.inject(result){|hash,pair|hash[pair.first]=pair.last;hash}end