Module: Crack
- Defined in:
- lib/crack.rb,
lib/crack/xml.rb,
lib/crack/json.rb,
lib/crack/json/backends/yajl.rb,
lib/crack/json/backends/yaml.rb,
lib/crack/json/backends/jsongem.rb
Defined Under Namespace
Modules: JSON
Classes: ParseError, XML
Constant Summary
collapse
- @@use_standard_json_time_format =
If true, use ISO 8601 format for dates and times. Otherwise, fall back to the Active Support legacy format.
true
- @@parse_json_times =
Look for and parse json strings that look like ISO 8601 times.
true
Class Method Summary
collapse
Class Method Details
.escape_html_entities_in_json ⇒ Object
64
65
66
|
# File 'lib/crack/json.rb', line 64
def escape_html_entities_in_json
@escape_html_entities_in_json
end
|
.escape_html_entities_in_json=(value) ⇒ Object
68
69
70
71
72
73
74
75
76
|
# File 'lib/crack/json.rb', line 68
def escape_html_entities_in_json=(value)
Crack::JSON::Encoding.escape_regex = \
if value
/[\010\f\n\r\t"\\><&]/
else
/[\010\f\n\r\t"\\]/
end
@escape_html_entities_in_json = value
end
|
.parse_json_times ⇒ Object
19
20
21
|
# File 'lib/crack/json.rb', line 19
def self.parse_json_times
@@parse_json_times
end
|
.parse_json_times=(val) ⇒ Object
22
23
24
|
# File 'lib/crack/json.rb', line 22
def self.parse_json_times=(val)
@@parse_json_times = val
end
|
13
14
15
|
# File 'lib/crack/json.rb', line 13
def self.use_standard_json_time_format
@@use_standard_json_time_format
end
|
16
17
18
|
# File 'lib/crack/json.rb', line 16
def self.use_standard_json_time_format=(val)
@@use_standard_json_time_format = val
end
|