Namespace
Methods
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

Class Public methods
encode(value, options = nil)

Dumps object in JSON (JavaScript Object Notation). See www.json.org for more info.

# File activesupport/lib/active_support/json/encoding.rb, line 30
def self.encode(value, options = nil)
  Encoding::Encoder.new(options).encode(value)
end
Instance Public methods
decode(json, options ={})
# File activesupport/lib/active_support/json/decoding.rb, line 11
def decode(json, options ={})
  # Can't reliably detect whether MultiJson responds to load, since it's
  # a reserved word. Use adapter as a proxy for new features.
  data = if MultiJson.respond_to?(:adapter)
    MultiJson.load(json, options)
  else
    MultiJson.decode(json, options)
  end
  if ActiveSupport.parse_json_times
    convert_dates_from(data)
  else
    data
  end
end
engine()
# File activesupport/lib/active_support/json/decoding.rb, line 26
def engine
  if MultiJson.respond_to?(:adapter)
    MultiJson.adapter
  else
    MultiJson.engine
  end
end
engine=(name)
# File activesupport/lib/active_support/json/decoding.rb, line 35
def engine=(name)
  if MultiJson.respond_to?(:use)
    MultiJson.use name
  else
    MultiJson.engine = name
  end
end
parse_error()
# File activesupport/lib/active_support/json/decoding.rb, line 51
def parse_error
  MultiJson::DecodeError
end
with_backend(name)
# File activesupport/lib/active_support/json/decoding.rb, line 44
def with_backend(name)
  old_backend, self.backend = backend, name
  yield
ensure
  self.backend = old_backend
end