{"action":"created","comment":{"url":"https://api.github.com/repos/nylas/nylas-ruby/pulls/comments/46990754","id":46990754,"diff_hunk":"@@ -114,11 +114,15 @@ def url_for_path(path)\n     end\n \n     def url_for_authentication(redirect_uri, login_hint = '', options = {})\n-      trialString = 'false'\n-      if options[:trial] == true\n-        trialString = 'true'\n-      end\n-      \"https://#{@service_domain}/oauth/authorize?client_id=#{@app_id}&trial=#{trialString}&response_type=code&scope=email&login_hint=#{login_hint}&redirect_uri=#{redirect_uri}\"\n+      arguments = {\n+        trial: false,\n+        login_hint: login_hint,\n+        client_id: @app_id,\n+        response_type: 'code',\n+        scpe: 'email',\n+        redirect_uri: redirect_uri\n+      }.merge(options)\n+      URI::HTTPS.build(host: \"#{@service_domain}/oauth/authorize\", query: arguments.to_query).to_s","path":"lib/inbox.rb","position":26,"original_position":26,"commit_id":"b684be790618c714d94bdf8d3616afdaa0ab95ed","original_commit_id":"b684be790618c714d94bdf8d3616afdaa0ab95ed","user":{"login":"zacstewart","id":435548,"avatar_url":"https://avatars.githubusercontent.com/u/435548?v=3","gravatar_id":"","url":"https://api.github.com/users/zacstewart","html_url":"https://github.com/zacstewart","followers_url":"https://api.github.com/users/zacstewart/followers","following_url":"https://api.github.com/users/zacstewart/following{/other_user}","gists_url":"https://api.github.com/users/zacstewart/gists{/gist_id}","starred_url":"https://api.github.com/users/zacstewart/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zacstewart/subscriptions","organizations_url":"https://api.github.com/users/zacstewart/orgs","repos_url":"https://api.github.com/users/zacstewart/repos","events_url":"https://api.github.com/users/zacstewart/events{/privacy}","received_events_url":"https://api.github.com/users/zacstewart/received_events","type":"User","site_admin":false},"body":"I may be wrong, but I think `Hash.to_query` comes from activesupport, not native Ruby.","created_at":"2015-12-08T18:15:39Z","updated_at":"2015-12-08T18:15:39Z","html_url":"https://github.com/nylas/nylas-ruby/pull/51#discussion_r46990754","pull_request_url":"https://api.github.com/repos/nylas/nylas-ruby/pulls/51","_links":{"self":{"href":"https://api.github.com/repos/nylas/nylas-ruby/pulls/comments/46990754"},"html":{"href":"https://github.com/nylas/nylas-ruby/pull/51#discussion_r46990754"},"pull_request":{"href":"https://api.github.com/repos/nylas/nylas-ruby/pulls/51"}}},"pull_request":{"url":"https://api.github.com/repos/nylas/nylas-ruby/pulls/51","id":48317027,"html_url":"https://github.com/nylas/nylas-ruby/pull/51","diff_url":"https://github.com/nylas/nylas-ruby/pull/51.diff","patch_url":"https://github.com/nylas/nylas-ruby/pull/51.patch","issue_url":"https://api.github.com/repos/nylas/nylas-ruby/issues/51","number":51,"state":"open","locked":false,"title":"Change url constructor in url_for_authentication","user":{"login":"Bartuz","id":4388676,"avatar_url":"https://avatars.githubusercontent.com/u/4388676?v=3","gravatar_id":"","url":"https://api.github.com/users/Bartuz","html_url":"https://github.com/Bartuz","followers_url":"https://api.github.com/users/Bartuz/followers","following_url":"https://api.github.com/users/Bartuz/following{/other_user}","gists_url":"https://api.github.com/users/Bartuz/gists{/gist_id}","starred_url":"https://api.github.com/users/Bartuz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Bartuz/subscriptions","organizations_url":"https://api.github.com/users/Bartuz/orgs","repos_url":"https://api.github.com/users/Bartuz/repos","events_url":"https://api.github.com/users/Bartuz/events{/privacy}","received_events_url":"https://api.github.com/users/Bartuz/received_events","type":"User","site_admin":false},"body":"You can't pass `state` argument with this method (which should be possible according to your docs). \r\n\r\nConstructing url with string interpolation is not really readable. I believe using URI helpers will make it much more easier and fun to maintain. \r\n\r\nIt needs specs probably, I'm not sure if `to_s` casting is necessary  but I'm just giving you idea, maybe I will polish it a bit later.","created_at":"2015-10-21T11:11:24Z","updated_at":"2015-12-08T18:15:39Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4779650bf04f5207ba734629ec950d606d64d293","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/nylas/nylas-ruby/pulls/51/commits","review_comments_url":"https://api.github.com/repos/nylas/nylas-ruby/pulls/51/comments","review_comment_url":"https://api.github.com/repos/nylas/nylas-ruby/pulls/comments{/number}","comments_url":"https://api.github.com/repos/nylas/nylas-ruby/issues/51/comments","statuses_url":"https://api.github.com/repos/nylas/nylas-ruby/statuses/b684be790618c714d94bdf8d3616afdaa0ab95ed","head":{"label":"Bartuz:master","ref":"master","sha":"b684be790618c714d94bdf8d3616afdaa0ab95ed","user":{"login":"Bartuz","id":4388676,"avatar_url":"https://avatars.githubusercontent.com/u/4388676?v=3","gravatar_id":"","url":"https://api.github.com/users/Bartuz","html_url":"https://github.com/Bartuz","followers_url":"https://api.github.com/users/Bartuz/followers","following_url":"https://api.github.com/users/Bartuz/following{/other_user}","gists_url":"https://api.github.com/users/Bartuz/gists{/gist_id}","starred_url":"https://api.github.com/users/Bartuz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Bartuz/subscriptions","organizations_url":"https://api.github.com/users/Bartuz/orgs","repos_url":"https://api.github.com/users/Bartuz/repos","events_url":"https://api.github.com/users/Bartuz/events{/privacy}","received_events_url":"https://api.github.com/users/Bartuz/received_events","type":"User","site_admin":false},"repo":{"id":44670064,"name":"nylas-ruby","full_name":"Bartuz/nylas-ruby","owner":{"login":"Bartuz","id":4388676,"avatar_url":"https://avatars.githubusercontent.com/u/4388676?v=3","gravatar_id":"","url":"https://api.github.com/users/Bartuz","html_url":"https://github.com/Bartuz","followers_url":"https://api.github.com/users/Bartuz/followers","following_url":"https://api.github.com/users/Bartuz/following{/other_user}","gists_url":"https://api.github.com/users/Bartuz/gists{/gist_id}","starred_url":"https://api.github.com/users/Bartuz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Bartuz/subscriptions","organizations_url":"https://api.github.com/users/Bartuz/orgs","repos_url":"https://api.github.com/users/Bartuz/repos","events_url":"https://api.github.com/users/Bartuz/events{/privacy}","received_events_url":"https://api.github.com/users/Bartuz/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Bartuz/nylas-ruby","description":"Ruby bindings for the Nylas platform","fork":true,"url":"https://api.github.com/repos/Bartuz/nylas-ruby","forks_url":"https://api.github.com/repos/Bartuz/nylas-ruby/forks","keys_url":"https://api.github.com/repos/Bartuz/nylas-ruby/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Bartuz/nylas-ruby/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Bartuz/nylas-ruby/teams","hooks_url":"https://api.github.com/repos/Bartuz/nylas-ruby/hooks","issue_events_url":"https://api.github.com/repos/Bartuz/nylas-ruby/issues/events{/number}","events_url":"https://api.github.com/repos/Bartuz/nylas-ruby/events","assignees_url":"https://api.github.com/repos/Bartuz/nylas-ruby/assignees{/user}","branches_url":"https://api.github.com/repos/Bartuz/nylas-ruby/branches{/branch}","tags_url":"https://api.github.com/repos/Bartuz/nylas-ruby/tags","blobs_url":"https://api.github.com/repos/Bartuz/nylas-ruby/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Bartuz/nylas-ruby/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Bartuz/nylas-ruby/git/refs{/sha}","trees_url":"https://api.github.com/repos/Bartuz/nylas-ruby/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Bartuz/nylas-ruby/statuses/{sha}","languages_url":"https://api.github.com/repos/Bartuz/nylas-ruby/languages","stargazers_url":"https://api.github.com/repos/Bartuz/nylas-ruby/stargazers","contributors_url":"https://api.github.com/repos/Bartuz/nylas-ruby/contributors","subscribers_url":"https://api.github.com/repos/Bartuz/nylas-ruby/subscribers","subscription_url":"https://api.github.com/repos/Bartuz/nylas-ruby/subscription","commits_url":"https://api.github.com/repos/Bartuz/nylas-ruby/commits{/sha}","git_commits_url":"https://api.github.com/repos/Bartuz/nylas-ruby/git/commits{/sha}","comments_url":"https://api.github.com/repos/Bartuz/nylas-ruby/comments{/number}","issue_comment_url":"https://api.github.com/repos/Bartuz/nylas-ruby/issues/comments{/number}","contents_url":"https://api.github.com/repos/Bartuz/nylas-ruby/contents/{+path}","compare_url":"https://api.github.com/repos/Bartuz/nylas-ruby/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Bartuz/nylas-ruby/merges","archive_url":"https://api.github.com/repos/Bartuz/nylas-ruby/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Bartuz/nylas-ruby/downloads","issues_url":"https://api.github.com/repos/Bartuz/nylas-ruby/issues{/number}","pulls_url":"https://api.github.com/repos/Bartuz/nylas-ruby/pulls{/number}","milestones_url":"https://api.github.com/repos/Bartuz/nylas-ruby/milestones{/number}","notifications_url":"https://api.github.com/repos/Bartuz/nylas-ruby/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Bartuz/nylas-ruby/labels{/name}","releases_url":"https://api.github.com/repos/Bartuz/nylas-ruby/releases{/id}","created_at":"2015-10-21T10:52:12Z","updated_at":"2015-10-21T10:52:13Z","pushed_at":"2015-10-21T17:26:05Z","git_url":"git://github.com/Bartuz/nylas-ruby.git","ssh_url":"git@github.com:Bartuz/nylas-ruby.git","clone_url":"https://github.com/Bartuz/nylas-ruby.git","svn_url":"https://github.com/Bartuz/nylas-ruby","homepage":"https://nylas.com/docs","size":376,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"nylas:master","ref":"master","sha":"13565c65526ef4d1e705f8749387e2057d5019d9","user":{"login":"nylas","id":4219865,"avatar_url":"https://avatars.githubusercontent.com/u/4219865?v=3","gravatar_id":"","url":"https://api.github.com/users/nylas","html_url":"https://github.com/nylas","followers_url":"https://api.github.com/users/nylas/followers","following_url":"https://api.github.com/users/nylas/following{/other_user}","gists_url":"https://api.github.com/users/nylas/gists{/gist_id}","starred_url":"https://api.github.com/users/nylas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nylas/subscriptions","organizations_url":"https://api.github.com/users/nylas/orgs","repos_url":"https://api.github.com/users/nylas/repos","events_url":"https://api.github.com/users/nylas/events{/privacy}","received_events_url":"https://api.github.com/users/nylas/received_events","type":"Organization","site_admin":false},"repo":{"id":22974275,"name":"nylas-ruby","full_name":"nylas/nylas-ruby","owner":{"login":"nylas","id":4219865,"avatar_url":"https://avatars.githubusercontent.com/u/4219865?v=3","gravatar_id":"","url":"https://api.github.com/users/nylas","html_url":"https://github.com/nylas","followers_url":"https://api.github.com/users/nylas/followers","following_url":"https://api.github.com/users/nylas/following{/other_user}","gists_url":"https://api.github.com/users/nylas/gists{/gist_id}","starred_url":"https://api.github.com/users/nylas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nylas/subscriptions","organizations_url":"https://api.github.com/users/nylas/orgs","repos_url":"https://api.github.com/users/nylas/repos","events_url":"https://api.github.com/users/nylas/events{/privacy}","received_events_url":"https://api.github.com/users/nylas/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/nylas/nylas-ruby","description":"Ruby bindings for the Nylas Platform APIs","fork":false,"url":"https://api.github.com/repos/nylas/nylas-ruby","forks_url":"https://api.github.com/repos/nylas/nylas-ruby/forks","keys_url":"https://api.github.com/repos/nylas/nylas-ruby/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nylas/nylas-ruby/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nylas/nylas-ruby/teams","hooks_url":"https://api.github.com/repos/nylas/nylas-ruby/hooks","issue_events_url":"https://api.github.com/repos/nylas/nylas-ruby/issues/events{/number}","events_url":"https://api.github.com/repos/nylas/nylas-ruby/events","assignees_url":"https://api.github.com/repos/nylas/nylas-ruby/assignees{/user}","branches_url":"https://api.github.com/repos/nylas/nylas-ruby/branches{/branch}","tags_url":"https://api.github.com/repos/nylas/nylas-ruby/tags","blobs_url":"https://api.github.com/repos/nylas/nylas-ruby/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nylas/nylas-ruby/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nylas/nylas-ruby/git/refs{/sha}","trees_url":"https://api.github.com/repos/nylas/nylas-ruby/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nylas/nylas-ruby/statuses/{sha}","languages_url":"https://api.github.com/repos/nylas/nylas-ruby/languages","stargazers_url":"https://api.github.com/repos/nylas/nylas-ruby/stargazers","contributors_url":"https://api.github.com/repos/nylas/nylas-ruby/contributors","subscribers_url":"https://api.github.com/repos/nylas/nylas-ruby/subscribers","subscription_url":"https://api.github.com/repos/nylas/nylas-ruby/subscription","commits_url":"https://api.github.com/repos/nylas/nylas-ruby/commits{/sha}","git_commits_url":"https://api.github.com/repos/nylas/nylas-ruby/git/commits{/sha}","comments_url":"https://api.github.com/repos/nylas/nylas-ruby/comments{/number}","issue_comment_url":"https://api.github.com/repos/nylas/nylas-ruby/issues/comments{/number}","contents_url":"https://api.github.com/repos/nylas/nylas-ruby/contents/{+path}","compare_url":"https://api.github.com/repos/nylas/nylas-ruby/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nylas/nylas-ruby/merges","archive_url":"https://api.github.com/repos/nylas/nylas-ruby/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nylas/nylas-ruby/downloads","issues_url":"https://api.github.com/repos/nylas/nylas-ruby/issues{/number}","pulls_url":"https://api.github.com/repos/nylas/nylas-ruby/pulls{/number}","milestones_url":"https://api.github.com/repos/nylas/nylas-ruby/milestones{/number}","notifications_url":"https://api.github.com/repos/nylas/nylas-ruby/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nylas/nylas-ruby/labels{/name}","releases_url":"https://api.github.com/repos/nylas/nylas-ruby/releases{/id}","created_at":"2014-08-15T01:29:08Z","updated_at":"2015-11-28T19:25:31Z","pushed_at":"2015-12-08T18:11:14Z","git_url":"git://github.com/nylas/nylas-ruby.git","ssh_url":"git@github.com:nylas/nylas-ruby.git","clone_url":"https://github.com/nylas/nylas-ruby.git","svn_url":"https://github.com/nylas/nylas-ruby","homepage":"https://nylas.com/docs","size":314,"stargazers_count":32,"watchers_count":32,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":22,"mirror_url":null,"open_issues_count":10,"forks":22,"open_issues":10,"watchers":32,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/nylas/nylas-ruby/pulls/51"},"html":{"href":"https://github.com/nylas/nylas-ruby/pull/51"},"issue":{"href":"https://api.github.com/repos/nylas/nylas-ruby/issues/51"},"comments":{"href":"https://api.github.com/repos/nylas/nylas-ruby/issues/51/comments"},"review_comments":{"href":"https://api.github.com/repos/nylas/nylas-ruby/pulls/51/comments"},"review_comment":{"href":"https://api.github.com/repos/nylas/nylas-ruby/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/nylas/nylas-ruby/pulls/51/commits"},"statuses":{"href":"https://api.github.com/repos/nylas/nylas-ruby/statuses/b684be790618c714d94bdf8d3616afdaa0ab95ed"}}}}