Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong # of Arguments #3

Open
anishaetienne opened this issue Apr 13, 2016 · 1 comment
Open

Wrong # of Arguments #3

anishaetienne opened this issue Apr 13, 2016 · 1 comment

Comments

@anishaetienne
Copy link

Getting the 'wrong # of arguments' error for:

sm = Surveymonkey::Client.new api_key: 'XXXXXXXXXXXX', access_token: 'YYYYYYYYYYYYYYYYYYYY'

Why would that error be thrown? Did something change?

@hakamadare
Copy link
Owner

yes! something did, and i utterly failed to update the README :( sorry about that. here's the relevant portion of lib/surveymonkey/client.rb:

  ##
  # Create a new Surveymonkey::Client object.  Requires the following parameters:
  # * baseuri
  # * access_token
  # * api_key

  def initialize(baseuri, access_token, api_key)
    begin
      @baseuri      = baseuri
      @access_token = access_token
      @api_key      = api_key

you have to pass three parameters, baseuri, access_token, and api_key.

however: what are you doing that you need to instantiate a Surveymonkey::Client? in general you should expose your API credentials via environment variables, and then call the class methods in Surveymonkey, i.e.

details = Surveymonkey.get_user_details

oh, and i also notice that SurveyMonkey has now published API version 3, which is very different (my client supports v2), i'll need to update the client. API v2 still works though, we use it every day.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants