instance method
as_json
Ruby on Rails 3.2.22.5
Since v3.0.20 Last seen in v4.0.13Signature
as_json(value, use_options = true)
like encode, but only calls as_json, without encoding to string
Parameters
-
valuereq -
use_optionsopt = true
Source
# File activesupport/lib/active_support/json/encoding.rb, line 53
def as_json(value, use_options = true)
check_for_circular_references(value) do
use_options ? value.as_json(options_for(value)) : value.as_json
end
end
Defined in activesupport/lib/active_support/json/encoding.rb line 53
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveSupport::JSON::Encoding::Encoder