Namespace
Methods
- B
- D
- E
- P
- W
Constants
DATE_REGEX | = | /^(?:\d{4}-\d{2}-\d{2}|\d{4}-\d{1,2}-\d{1,2}[T \t]+\d{1,2}:\d{2}:\d{2}(\.[0-9]*)?(([ \t]*)Z|[-+]\d{2}?(:\d{2})?))$/ |
matches YAML-formatted dates |
||
CircularReferenceError | = | Deprecation::DeprecatedConstantProxy.new('ActiveSupport::JSON::CircularReferenceError', Encoding::CircularReferenceError) |
Class Public methods
Source: show
# File activesupport/lib/active_support/json/decoding.rb, line 11 def decode(json, options ={}) data = MultiJson.decode(json, options) if ActiveSupport.parse_json_times convert_dates_from(data) else data end end
Dumps object in JSON (JavaScript Object Notation). See www.json.org for more info.
Source: show
# File activesupport/lib/active_support/json/encoding.rb, line 30 def self.encode(value, options = nil) Encoding::Encoder.new(options).encode(value) end
Also aliased as: backend
Source: show
# File activesupport/lib/active_support/json/decoding.rb, line 20 def engine MultiJson.engine end
Also aliased as: backend=
Source: show
# File activesupport/lib/active_support/json/decoding.rb, line 25 def engine=(name) MultiJson.engine = name end
Source: show
# File activesupport/lib/active_support/json/decoding.rb, line 37 def parse_error MultiJson::DecodeError end
Source: show
# File activesupport/lib/active_support/json/decoding.rb, line 30 def with_backend(name) old_backend, self.backend = backend, name yield ensure self.backend = old_backend end