CambridgeEducation / qualtrics_api

Qualtrics REST API Ruby Wrapper (Api version 3)
MIT License
6 stars 8 forks source link

Remove connection injection #10

Closed nglx closed 9 years ago

nglx commented 9 years ago

Since the api allows to chain commands like:

client.panels.find("panelIdHere").members.create(panel_member)

we have to inject the connection to the chained objects.

Let's change the api so the client is not instantiated but configured:

QualtricsAPI.configure do |c|
  c.api_token = 'xxx'
end

QualtricsAPI.panels

Leaving the current implementation with client new would be inconsistent in that case (suggesting that we can have multiple clients):

client = QualtricsAPI.new(:api_token => 'xxx')

This will simplify the implementation. Makes sense?

pallymore commented 9 years ago

yes...please do :)

nglx commented 9 years ago

it's implemented in #11