Sha256: 33d6e88db87cbb9c954c93cc453455fd0f254561838d8ba3fe2caf13f1659515

Contents?: true

Size: 789 Bytes

Versions: 26

Compression:

Stored size: 789 Bytes

Contents

require 'active_support/core_ext/module/attribute_accessors'

module ActiveSupport
  # Look for and parse json strings that look like ISO 8601 times.
  mattr_accessor :parse_json_times

  module JSON
    class << self
      delegate :decode, :to => :backend

      def backend
        self.backend = "Yaml" unless defined?(@backend)
        @backend
      end

      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
      end

      def with_backend(name)
        old_backend, self.backend = backend, name
        yield
      ensure
        self.backend = old_backend
      end
    end
  end
end

Version data entries

26 entries across 25 versions & 7 rubygems

Version Path
radiantcms-couchrest_model-0.2.4 vendor/rails/activesupport/lib/active_support/json/decoding.rb
radiantcms-couchrest_model-0.2.2 vendor/rails/activesupport/lib/active_support/json/decoding.rb
radiantcms-couchrest_model-0.2.1 vendor/rails/activesupport/lib/active_support/json/decoding.rb
radiantcms-couchrest_model-0.2 vendor/rails/activesupport/lib/active_support/json/decoding.rb
radiantcms-couchrest_model-0.1.9 vendor/rails/activesupport/lib/active_support/json/decoding.rb
radiantcms-couchrest_model-0.1.8 vendor/rails/activesupport/lib/active_support/json/decoding.rb
radiantcms-couchrest_model-0.1.7 vendor/rails/activesupport/lib/active_support/json/decoding.rb
radiantcms-couchrest_model-0.1.6 vendor/rails/activesupport/lib/active_support/json/decoding.rb
radiantcms-couchrest_model-0.1.5 vendor/rails/activesupport/lib/active_support/json/decoding.rb
radiant-0.8.2 vendor/rails/activesupport/lib/active_support/json/decoding.rb
usher-0.7.0 spec/rails2_3/vendor/rails/vendor/rails/activesupport/pkg/activesupport-2.3.3/lib/active_support/json/decoding.rb
usher-0.7.0 spec/rails2_3/vendor/rails/vendor/rails/activesupport/lib/active_support/json/decoding.rb
ginst-2009.12.8 vendor/rails/activesupport/lib/active_support/json/decoding.rb
ginst-2009.11.24 vendor/rails/activesupport/lib/active_support/json/decoding.rb
ginst-2009.11.23 vendor/rails/activesupport/lib/active_support/json/decoding.rb
ginst-2.0.1 vendor/rails/activesupport/lib/active_support/json/decoding.rb
ginst-2.0.0 vendor/rails/activesupport/lib/active_support/json/decoding.rb
gemstreamer-1.2.0 spec/assets/testapp/vendor/rails/activesupport/lib/active_support/json/decoding.rb
gemstreamer-1.1.1 spec/assets/testapp/vendor/rails/activesupport/lib/active_support/json/decoding.rb
gemstreamer-1.1.0 spec/assets/testapp/vendor/rails/activesupport/lib/active_support/json/decoding.rb