Namespace
Methods
B
S
W
Constants
DECODERS = %w(Yajl OkJson)
 

Listed in order of preference.

DATE_REGEX = /^(?:\d{4}-\d{2}-\d{2}|\d{4}-\d{1,2}-\d{1,2}[ \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)
 
Attributes
[R] parse_error
Class Public methods
backend()
# File activesupport/lib/active_support/json/decoding.rb, line 15
def backend
  set_default_backend unless defined?(@backend)
  @backend
end
backend=(name)
# File activesupport/lib/active_support/json/decoding.rb, line 20
def backend=(name)
  if name.is_a?(Module)
    @backend = name
  else
    require "active_support/json/backends/#{name.to_s.downcase}.rb"
    @backend = ActiveSupport::JSON::Backends::const_get(name)
  end
  @parse_error = @backend::ParseError
end
set_default_backend()
# File activesupport/lib/active_support/json/decoding.rb, line 37
def set_default_backend
  DECODERS.find do |name|
    begin
      self.backend = name
      true
    rescue LoadError
      # Try next decoder.
      false
    end
  end
end
with_backend(name)
# 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