Permalink
Browse files

Use new deprecate method for MultiJson.engine=

  • Loading branch information...
1 parent be020a3 commit 0c54fd3b863422436f687a1128f05524199c78d6 @sferik sferik committed Apr 16, 2012
Showing with 4 additions and 9 deletions.
  1. +4 −9 lib/multi_json.rb
View
@@ -47,12 +47,6 @@ def engine
self.adapter
end
- # TODO: Remove for 2.0 release (but no sooner)
- def engine=(new_engine)
- Kernel.warn "#{Kernel.caller.first}: [DEPRECATION] MultiJson.engine= is deprecated and will be removed in the next major version. Use MultiJson.use instead."
- self.use(new_engine)
- end
-
# Get the current adapter class.
def adapter
return @adapter if @adapter
@@ -61,9 +55,9 @@ def adapter
end
# TODO: Remove for 2.0 release (but no sooner)
- def adapter=(new_adapter)
- deprecate("MultiJson.adapter= is deprecated and will be removed in the next major version. Use MultiJson.use instead.")
- self.use(new_adapter)
+ def engine=(new_engine)
+ deprecate("MultiJson.engine= is deprecated and will be removed in the next major version. Use MultiJson.use instead.")
+ self.use(new_engine)
end
# Set the JSON parser utilizing a symbol, string, or class.
@@ -88,6 +82,7 @@ def use(new_adapter)
raise "Did not recognize your adapter specification. Please specify either a symbol or a class."
end
end
+ alias :adapter= :use
# TODO: Remove for 2.0 release (but no sooner)
def decode(string, options={})

0 comments on commit 0c54fd3

Please sign in to comment.