GitHub PullRequestReviewCommentEvent at 2014-02-19 17:54:10
Repository: strong-remoting
Actor: ritch
Payload: {"comment":{"url":"https://api.github.com/repos/strongloop/strong-remoting/pulls/comments/9875001","id":9875001,"diff_hunk":"@@ -0,0 +1,182 @@\n+/**\n+ * Expose `HttpInvokation`.\n+ */\n+\n+module.exports = HttpInvokation;\n+\n+/**\n+ * Module dependencies.\n+ */\n+\n+var EventEmitter = require('events').EventEmitter\n+  , debug = require('debug')('strong-remoting:http-invokation')\n+  , util = require('util')\n+  , inherits = util.inherits\n+  , path = require('path')\n+  , assert = require('assert')\n+  , request = require('request')\n+  , SUPPORTED_TYPES = ['json', 'application/javascript', 'text/javascript'];\n+\n+/**\n+ * Create a new `HttpInvokation`.\n+ */\n+\n+function HttpInvokation(method, args, base) {\n+  this.base = base;\n+  this.method = method;\n+  this.args = args || [];\n+  var namedArgs = this.namedArgs = {};\n+  var val;\n+  var type;\n+  \n+  method.accepts.forEach(function(accept) {\n+    val = args.shift();\n+    if(HttpInvokation.isAcceptable(val, accept)) {\n+      namedArgs[accept.arg || accept.name] = val;\n+    }\n+  });\n+}\n+\n+/**\n+ * Inherit from `EventEmitter`.\n+ */\n+\n+inherits(HttpInvokation, EventEmitter);\n+\n+/**\n+ * Determine if the value matches the given accept definition.\n+ */\n+\n+HttpInvokation.isAcceptable = function(val, accept) {\n+  var type = accept.type && accept.type.toLowerCase();\n+  var strict = type || type !== 'any';","path":"lib/http-invokation.js","position":52,"original_position":52,"commit_id":"c84b56a228f11af6bccbf60fa802a598d49cf45d","original_commit_id":"c84b56a228f11af6bccbf60fa802a598d49cf45d","user":{"login":"ritch","id":462228,"avatar_url":"https://gravatar.com/avatar/9c9b14104d3df09372c22605441a40da?d=https%3A%2F%2Fidenticons.github.com%2F98e5b95aa494ad72856ba7ee38e17c35.png&r=x","gravatar_id":"9c9b14104d3df09372c22605441a40da","url":"https://api.github.com/users/ritch","html_url":"https://github.com/ritch","followers_url":"https://api.github.com/users/ritch/followers","following_url":"https://api.github.com/users/ritch/following{/other_user}","gists_url":"https://api.github.com/users/ritch/gists{/gist_id}","starred_url":"https://api.github.com/users/ritch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ritch/subscriptions","organizations_url":"https://api.github.com/users/ritch/orgs","repos_url":"https://api.github.com/users/ritch/repos","events_url":"https://api.github.com/users/ritch/events{/privacy}","received_events_url":"https://api.github.com/users/ritch/received_events","type":"User","site_admin":false},"body":"Good catch","created_at":"2014-02-19T17:54:10Z","updated_at":"2014-02-19T17:54:10Z","html_url":"https://github.com/strongloop/strong-remoting/pull/44#discussion_r9875001","pull_request_url":"https://api.github.com/repos/strongloop/strong-remoting/pulls/44","_links":{"self":{"href":"https://api.github.com/repos/strongloop/strong-remoting/pulls/comments/9875001"},"html":{"href":"https://github.com/strongloop/strong-remoting/pull/44#discussion_r9875001"},"pull_request":{"href":"https://api.github.com/repos/strongloop/strong-remoting/pulls/44"}}}}