Skip to content
Browse files

Updated readme for the new load/dump syntax

  • Loading branch information...
1 parent 86198e3 commit 563425323ac0d75c895269d477a63bf1b54dcfff @arsduo arsduo committed Apr 16, 2012
Showing with 5 additions and 6 deletions.
  1. +5 −6 README.md
View
11 README.md
@@ -10,13 +10,12 @@ fastest available JSON coder. Here's how to use it:
require 'multi_json'
- MultiJson.decode('{"abc":"def"}') #=> {"abc" => "def"}
- MultiJson.decode('{"abc":"def"}', :symbolize_keys => true) #=> {:abc => "def"}
- MultiJson.encode({:abc => 'def'}) # convert Ruby back to JSON
- MultiJson.encode({:abc => 'def'}, :pretty => true) # encoded in a pretty form (if supported by the coder)
+ MultiJson.load('{"abc":"def"}') #=> {"abc" => "def"}
+ MultiJson.load('{"abc":"def"}', :symbolize_keys => true) #=> {:abc => "def"}
+ MultiJson.dump({:abc => 'def'}) # convert Ruby back to JSON
+ MultiJson.dump({:abc => 'def'}, :pretty => true) # encoded in a pretty form (if supported by the coder)
-The `engine` setter takes either a symbol or a class (to allow for custom JSON
-parsers) that responds to both `.decode` and `.encode` at the class level.
+The `use` method, which sets the MultiJson adapter, takes either a symbol or a class (to allow for custom JSON parsers) that responds to both `.load` and `.dump` at the class level.
MultiJSON tries to have intelligent defaulting. That is, if you have any of the
supported engines already loaded, it will utilize them before attempting to

0 comments on commit 5634253

Please sign in to comment.
Something went wrong with that request. Please try again.