Methods
- A
- E
- N
- O
Attributes
[R] | options |
Class Public methods
Instance Public methods
like encode, but only calls as_json, without encoding to string
# File activesupport/lib/active_support/json/encoding.rb, line 45 45: def encode(value, use_options = true) 46: check_for_circular_references(value) do 47: jsonified = use_options ? value.as_json(options_for(value)) : value.as_json 48: jsonified.encode_json(self) 49: end 50: end
# File activesupport/lib/active_support/json/encoding.rb, line 59 59: def options_for(value) 60: if value.is_a?(Array) || value.is_a?(Hash) 61: # hashes and arrays need to get encoder in the options, so that they can detect circular references 62: options.merge(:encoder => self) 63: else 64: options 65: end 66: end