I am working on building an api client for the Rakuten MarketPlace. I
got some test requests for add delete update etc working and thought I
should aim to structure it as a Gem and publish it so that others can
I havn’t built a Gem before (worked mostly within the rails environment
Have been reading and looking at other api client gems and am making
progress on building something (still got a way to go to handle errors
To make the gem general purpose though, I am trying to figure out the
way to provide the mapping between models in a rails app and the api
client objects (such as product, category, order etc).
I am aiming to make each client api object a class be (or should i call
Then I suspect I will use new to build an api instance from a rails
instance, and find to return an api instance to a rails instance.
i can build in mapping for my own models to the api objects with no
problem, but I can’t see how I could generalize this so that other apps
with similar models could use the gem.
I suspect there are approaches for doing this, but so far I haven’t
to come up with how to do it. If anyone has any wisdom on the matter I
would be grateful.