lib/active_support/json/decoding.rb in activesupport-3.0.0.beta4 vs lib/active_support/json/decoding.rb in activesupport-3.0.pre
- old
+ new
@@ -4,19 +4,16 @@
module ActiveSupport
# Look for and parse json strings that look like ISO 8601 times.
mattr_accessor :parse_json_times
module JSON
- # Listed in order of preference.
- DECODERS = %w(Yajl Yaml)
-
class << self
attr_reader :parse_error
delegate :decode, :to => :backend
def backend
- set_default_backend unless defined?(@backend)
+ self.backend = "Yaml" unless defined?(@backend)
@backend
end
def backend=(name)
if name.is_a?(Module)
@@ -31,21 +28,9 @@
def with_backend(name)
old_backend, self.backend = backend, name
yield
ensure
self.backend = old_backend
- end
-
- def set_default_backend
- DECODERS.find do |name|
- begin
- self.backend = name
- true
- rescue LoadError
- # Try next decoder.
- false
- end
- end
end
end
end
end