Open chrismytton opened 8 years ago
Creating an adapter, like the existing open-uri and capybara ones, requires a lot of boilerplate code. For example the scraped_page_archive method I added to both adapters in https://github.com/everypolitician/scraped_page_archive/pull/53.
open-uri
capybara
scraped_page_archive
Add a module that can be included or a class that can be subclassed which has some essential adapter methods. Then the adapters themselves can just focus on glueing the http client to the archive.
Problem
Creating an adapter, like the existing
open-uri
andcapybara
ones, requires a lot of boilerplate code. For example thescraped_page_archive
method I added to both adapters in https://github.com/everypolitician/scraped_page_archive/pull/53.Proposed solution
Add a module that can be included or a class that can be subclassed which has some essential adapter methods. Then the adapters themselves can just focus on glueing the http client to the archive.