Module: MultiJson Deprecated
- Defined in:
- lib/multi_json.rb
Overview
Use MultiJSON (all-caps) instead. Will be removed in v2.0.
Backward-compatible alias for the legacy “MultiJson“ constant name
Downstream code that still writes “MultiJson.parse(…)“ or “rescue MultiJson::ParseError“ continues to work, but emits a one-time deprecation warning pointing at “MultiJSON“. Each public method on MultiJSON gets an explicit forwarder defined on this module, and constant access resolves via MultiJson.const_missing, so both dotted calls and “::“ constant lookups (including rescue clauses) route through the canonical module.
Class Method Summary collapse
-
.const_missing(name) ⇒ Object
Resolve missing constants to their MultiJSON counterparts.
Class Method Details
.const_missing(name) ⇒ Object
Resolve missing constants to their MultiJSON counterparts
Enables “rescue MultiJson::ParseError“ and “MultiJson::Adapters::Oj“ to keep working during the deprecation cycle.
314 315 316 317 318 |
# File 'lib/multi_json.rb', line 314 def const_missing(name) ::MultiJSON.warn_deprecation_once(:multi_json_constant, "The MultiJson constant is deprecated and will be removed in v2.0. Use MultiJSON instead.") ::MultiJSON.const_get(name) end |