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/false_class.rb | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 activesupport/lib/active_support/json/encoders/false_class.rb (limited to 'activesupport/lib/active_support/json/encoders/false_class.rb') diff --git a/activesupport/lib/active_support/json/encoders/false_class.rb b/activesupport/lib/active_support/json/encoders/false_class.rb new file mode 100644 index 0000000000..78524e2a03 --- /dev/null +++ b/activesupport/lib/active_support/json/encoders/false_class.rb @@ -0,0 +1,5 @@ +class FalseClass + def to_json #:nodoc: + 'false' + end +end -- cgit v1.2.3