Module: ActiveSupport::JSON::Encoding

Defined in:
activesupport/lib/active_support/json/encoding.rb

Overview

:nodoc:

Defined Under Namespace

Classes: JSONGemEncoder

Class Attribute Summary collapse

Class Attribute Details

.escape_html_entities_in_jsonObject

If true, encode >, <, & as escaped unicode sequences (e.g. > as u003e) as a safety measure.



117
118
119
# File 'activesupport/lib/active_support/json/encoding.rb', line 117

def escape_html_entities_in_json
  @escape_html_entities_in_json
end

.json_encoderObject

Sets the encoder used by Rails to encode Ruby objects into JSON strings in Object#to_json and ActiveSupport::JSON.encode.



125
126
127
# File 'activesupport/lib/active_support/json/encoding.rb', line 125

def json_encoder
  @json_encoder
end

.time_precisionObject

Sets the precision of encoded time values. Defaults to 3 (equivalent to millisecond precision)



121
122
123
# File 'activesupport/lib/active_support/json/encoding.rb', line 121

def time_precision
  @time_precision
end

.use_standard_json_time_formatObject

If true, use ISO 8601 format for dates and times. Otherwise, fall back to the Active Support legacy format.



113
114
115
# File 'activesupport/lib/active_support/json/encoding.rb', line 113

def use_standard_json_time_format
  @use_standard_json_time_format
end