wingrunr21 / mindbody-api

A Ruby interface to the MindBody API v0.5
http://wingrunr21.github.com/mindbody-api
MIT License
29 stars 46 forks source link

Per-call credentials #31

Open eropple opened 8 years ago

eropple commented 8 years ago

I'm building something that requires access to multiple MindBody customers at a time. To that end I've extended MindBody::Client to support this by passing in an auth: parameter alongside message: and written tests to cover the major cases for it (no auth:, auth: with source credentials, auth: with both source and user credentials).

Also, some tests were broken in master and I've fixed those as part of this branch.

wingrunr21 commented 8 years ago

Overall this looks ok. I'll need a README update.

Is this strategy of per-call overrides preferable over multiple instances? I'd actually considered removing the singleton-style of configuration and having the user create different instances instead (ala faraday).

eropple commented 8 years ago

I would totally love to do it via a configuration thing, but that was a way bigger change and I'm not super comfortable with the object model in here right now--figuring out where everything would need to be touched is a pretty big step.