Why an Adapter?
Understand the advantages of using an adapter class to handle interactions with external services in your Rails application. Learn how adapters help manage authentication, unify API terminology, and improve security and error handling while simplifying test integration.
We'll cover the following...
We'll cover the following...
Adapter advantages
Using an adapter class to mediate interaction with the external service is a good idea even when, like Twitter, the external service already has a Ruby gem. The adapter encapsulates logic that is specific to the interaction between our application and the service.
An adapter is useful if our code has any or all of the following qualities: