dnunez24/channeladvisor — pull request #1 by ttdonovan (2012-04-18 22:48:34+00:00)
Title: added new Admin class for the AdminService.asmx

I'm looking into integration options the ChannelAdvisor API and found your gem. To get a better understanding of your code structure and test coverage I implemented a new class for the AdminService and fixed a few of your failing specs from the 'refactor' branch. As the code is now it appears that there is going to be lots of duplication and I have some suggestions for possibly drying up the code. My first incline is to create a services module and a class for each service inside. Each request to the API would be a from a service instance. Something like this:

os = ChannelAdvisor::Services::OrderService.new
os.ping
# sends soap API ping request, setting and last_response and returning the response
os.last_request
# soap request object
os.last_response
# soap response object

and since #ping is implement in all services it could possibly be moved into a Pingable module.

It's an idea I'm toying around with and would like to hear your feedback. I could create an new feature branch 'service-instances' and implement some of the code for a better example.

Cheers,
Tanner