From 3202fbabe6df3591d7e2c35727ea9c8b68df8828 Mon Sep 17 00:00:00 2001 From: Sam Stephenson Date: Sun, 18 Mar 2007 07:05:58 +0000 Subject: Refactor ActiveSupport::JSON to be less obtuse. Add support for JSON decoding by way of Syck with ActiveSupport::JSON.decode(json_string). Prevent hash keys that are JavaScript reserved words from being unquoted during encoding. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6443 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- activesupport/lib/active_support/json/encoders.rb | 25 ----------------------- 1 file changed, 25 deletions(-) delete mode 100644 activesupport/lib/active_support/json/encoders.rb (limited to 'activesupport/lib/active_support/json/encoders.rb') diff --git a/activesupport/lib/active_support/json/encoders.rb b/activesupport/lib/active_support/json/encoders.rb deleted file mode 100644 index c3e3619f59..0000000000 --- a/activesupport/lib/active_support/json/encoders.rb +++ /dev/null @@ -1,25 +0,0 @@ -module ActiveSupport - module JSON #:nodoc: - module Encoders - mattr_accessor :encoders - @@encoders = {} - - class << self - def define_encoder(klass, &block) - encoders[klass] = block - end - - def [](klass) - klass.ancestors.each do |k| - encoder = encoders[k] - return encoder if encoder - end - end - end - end - end -end - -Dir[File.dirname(__FILE__) + '/encoders/*.rb'].each do |file| - require file[0..-4] -end -- cgit v1.2.3