httparty icon indicating copy to clipboard operation
httparty copied to clipboard

Deprecates method delegation via method_missing

Open JonMidhir opened this issue 7 years ago • 0 comments

Delegating methods to other objects using method_missing in instances of HTTParty::Response is causing unexpected behaviour and has resulted in multiple issues. Work-arounds to specific issues have been successful but this change starts the process of removing the root cause.

Discussion at https://github.com/jnunemaker/httparty/issues/381

  • The user will receive a deprecation warning when using a method that is delegated.
  • To remove the warning they should call the method on response or parsed_response instead.
  • To opt-in to the new behaviour globally the user can call HTTParty::Response.disable_method_delegation!

Most of this code is temporary, to facilitate the transition from one set of behaviours to another.

JonMidhir avatar Aug 02 '17 22:08 JonMidhir