{"action":"created","comment":{"url":"https://api.github.com/repos/g-ortuno/eddystone/pulls/comments/37817712","id":37817712,"diff_hunk":"@@ -84,6 +84,88 @@\n   let encoder = new TextEncoder('utf-8');\n \n   /**\n+     Exposes platform independent functions to register/unregiser Eddystone\n+     Advertisements.\n+     @class\n+   */\n+  class Eddystone {\n+    /**\n+       @constructs Eddystone\n+     */\n+    constructor() {\n+      /**\n+         @member Eddystone#advertisements {EddystoneAdvertisement[]} Contains all\n+         previously registered advertisements\n+       */\n+      this.advertisements = [];\n+    }\n+    /**\n+       Function to register an Eddystone BLE advertisement.\n+       @returns {Promise} Which `fulfills` with an {EddystoneAdvertisement} if\n+       the advertisement was registered successfully, `rejects` with `error`\n+       otherwise.\n+     */\n+    registerAdvertisement(options) {\n+      let self = this;\n+      return new Promise((resolve, reject) => {\n+        Eddystone._checkAdvertisementOptions(options);\n+        return Eddystone._getPlatform().registerAdvertisement(options).then(advertisement => {\n+          self.advertisements.push(advertisement);\n+          resolve(advertisement);\n+        }, reject);\n+      });\n+    }\n+\n+    /**\n+       Detects what API is available in the platform.\n+       @private\n+       @returns {Object} An object that wraps the underlying API\n+       @throws {Error} If the platform is unsupported\n+     */\n+    static _getPlatform() {","path":"libraries/eddystone-advertising-library/eddystone-advertising.js","position":42,"original_position":42,"commit_id":"04109fbc848d9e442dcbb8d643f7e5936d028996","original_commit_id":"04109fbc848d9e442dcbb8d643f7e5936d028996","user":{"login":"jyasskin","id":83420,"avatar_url":"https://avatars.githubusercontent.com/u/83420?v=3","gravatar_id":"","url":"https://api.github.com/users/jyasskin","html_url":"https://github.com/jyasskin","followers_url":"https://api.github.com/users/jyasskin/followers","following_url":"https://api.github.com/users/jyasskin/following{/other_user}","gists_url":"https://api.github.com/users/jyasskin/gists{/gist_id}","starred_url":"https://api.github.com/users/jyasskin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jyasskin/subscriptions","organizations_url":"https://api.github.com/users/jyasskin/orgs","repos_url":"https://api.github.com/users/jyasskin/repos","events_url":"https://api.github.com/users/jyasskin/events{/privacy}","received_events_url":"https://api.github.com/users/jyasskin/received_events","type":"User","site_admin":false},"body":"Probably call this in the constructor, since it's not going to change during the life of the instance.","created_at":"2015-08-24T23:32:08Z","updated_at":"2015-08-24T23:32:08Z","html_url":"https://github.com/g-ortuno/eddystone/pull/7#discussion_r37817712","pull_request_url":"https://api.github.com/repos/g-ortuno/eddystone/pulls/7","_links":{"self":{"href":"https://api.github.com/repos/g-ortuno/eddystone/pulls/comments/37817712"},"html":{"href":"https://github.com/g-ortuno/eddystone/pull/7#discussion_r37817712"},"pull_request":{"href":"https://api.github.com/repos/g-ortuno/eddystone/pulls/7"}}},"pull_request":{"url":"https://api.github.com/repos/g-ortuno/eddystone/pulls/7","id":43233912,"html_url":"https://github.com/g-ortuno/eddystone/pull/7","diff_url":"https://github.com/g-ortuno/eddystone/pull/7.diff","patch_url":"https://github.com/g-ortuno/eddystone/pull/7.patch","issue_url":"https://api.github.com/repos/g-ortuno/eddystone/issues/7","number":7,"state":"open","locked":false,"title":"Implement Eddystone","user":{"login":"g-ortuno","id":3117611,"avatar_url":"https://avatars.githubusercontent.com/u/3117611?v=3","gravatar_id":"","url":"https://api.github.com/users/g-ortuno","html_url":"https://github.com/g-ortuno","followers_url":"https://api.github.com/users/g-ortuno/followers","following_url":"https://api.github.com/users/g-ortuno/following{/other_user}","gists_url":"https://api.github.com/users/g-ortuno/gists{/gist_id}","starred_url":"https://api.github.com/users/g-ortuno/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/g-ortuno/subscriptions","organizations_url":"https://api.github.com/users/g-ortuno/orgs","repos_url":"https://api.github.com/users/g-ortuno/repos","events_url":"https://api.github.com/users/g-ortuno/events{/privacy}","received_events_url":"https://api.github.com/users/g-ortuno/received_events","type":"User","site_admin":false},"body":"@jyasskin: PTAL","created_at":"2015-08-24T23:25:06Z","updated_at":"2015-08-24T23:32:08Z","closed_at":null,"merged_at":null,"merge_commit_sha":"62e7e7a1159f127e5920294bd098fa0ccf681156","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/g-ortuno/eddystone/pulls/7/commits","review_comments_url":"https://api.github.com/repos/g-ortuno/eddystone/pulls/7/comments","review_comment_url":"https://api.github.com/repos/g-ortuno/eddystone/pulls/comments{/number}","comments_url":"https://api.github.com/repos/g-ortuno/eddystone/issues/7/comments","statuses_url":"https://api.github.com/repos/g-ortuno/eddystone/statuses/04109fbc848d9e442dcbb8d643f7e5936d028996","head":{"label":"g-ortuno:library-eddystone-final","ref":"library-eddystone-final","sha":"04109fbc848d9e442dcbb8d643f7e5936d028996","user":{"login":"g-ortuno","id":3117611,"avatar_url":"https://avatars.githubusercontent.com/u/3117611?v=3","gravatar_id":"","url":"https://api.github.com/users/g-ortuno","html_url":"https://github.com/g-ortuno","followers_url":"https://api.github.com/users/g-ortuno/followers","following_url":"https://api.github.com/users/g-ortuno/following{/other_user}","gists_url":"https://api.github.com/users/g-ortuno/gists{/gist_id}","starred_url":"https://api.github.com/users/g-ortuno/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/g-ortuno/subscriptions","organizations_url":"https://api.github.com/users/g-ortuno/orgs","repos_url":"https://api.github.com/users/g-ortuno/repos","events_url":"https://api.github.com/users/g-ortuno/events{/privacy}","received_events_url":"https://api.github.com/users/g-ortuno/received_events","type":"User","site_admin":false},"repo":{"id":39163427,"name":"eddystone","full_name":"g-ortuno/eddystone","owner":{"login":"g-ortuno","id":3117611,"avatar_url":"https://avatars.githubusercontent.com/u/3117611?v=3","gravatar_id":"","url":"https://api.github.com/users/g-ortuno","html_url":"https://github.com/g-ortuno","followers_url":"https://api.github.com/users/g-ortuno/followers","following_url":"https://api.github.com/users/g-ortuno/following{/other_user}","gists_url":"https://api.github.com/users/g-ortuno/gists{/gist_id}","starred_url":"https://api.github.com/users/g-ortuno/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/g-ortuno/subscriptions","organizations_url":"https://api.github.com/users/g-ortuno/orgs","repos_url":"https://api.github.com/users/g-ortuno/repos","events_url":"https://api.github.com/users/g-ortuno/events{/privacy}","received_events_url":"https://api.github.com/users/g-ortuno/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/g-ortuno/eddystone","description":"Specification for Eddystone, an open beacon format from Google","fork":true,"url":"https://api.github.com/repos/g-ortuno/eddystone","forks_url":"https://api.github.com/repos/g-ortuno/eddystone/forks","keys_url":"https://api.github.com/repos/g-ortuno/eddystone/keys{/key_id}","collaborators_url":"https://api.github.com/repos/g-ortuno/eddystone/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/g-ortuno/eddystone/teams","hooks_url":"https://api.github.com/repos/g-ortuno/eddystone/hooks","issue_events_url":"https://api.github.com/repos/g-ortuno/eddystone/issues/events{/number}","events_url":"https://api.github.com/repos/g-ortuno/eddystone/events","assignees_url":"https://api.github.com/repos/g-ortuno/eddystone/assignees{/user}","branches_url":"https://api.github.com/repos/g-ortuno/eddystone/branches{/branch}","tags_url":"https://api.github.com/repos/g-ortuno/eddystone/tags","blobs_url":"https://api.github.com/repos/g-ortuno/eddystone/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/g-ortuno/eddystone/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/g-ortuno/eddystone/git/refs{/sha}","trees_url":"https://api.github.com/repos/g-ortuno/eddystone/git/trees{/sha}","statuses_url":"https://api.github.com/repos/g-ortuno/eddystone/statuses/{sha}","languages_url":"https://api.github.com/repos/g-ortuno/eddystone/languages","stargazers_url":"https://api.github.com/repos/g-ortuno/eddystone/stargazers","contributors_url":"https://api.github.com/repos/g-ortuno/eddystone/contributors","subscribers_url":"https://api.github.com/repos/g-ortuno/eddystone/subscribers","subscription_url":"https://api.github.com/repos/g-ortuno/eddystone/subscription","commits_url":"https://api.github.com/repos/g-ortuno/eddystone/commits{/sha}","git_commits_url":"https://api.github.com/repos/g-ortuno/eddystone/git/commits{/sha}","comments_url":"https://api.github.com/repos/g-ortuno/eddystone/comments{/number}","issue_comment_url":"https://api.github.com/repos/g-ortuno/eddystone/issues/comments{/number}","contents_url":"https://api.github.com/repos/g-ortuno/eddystone/contents/{+path}","compare_url":"https://api.github.com/repos/g-ortuno/eddystone/compare/{base}...{head}","merges_url":"https://api.github.com/repos/g-ortuno/eddystone/merges","archive_url":"https://api.github.com/repos/g-ortuno/eddystone/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/g-ortuno/eddystone/downloads","issues_url":"https://api.github.com/repos/g-ortuno/eddystone/issues{/number}","pulls_url":"https://api.github.com/repos/g-ortuno/eddystone/pulls{/number}","milestones_url":"https://api.github.com/repos/g-ortuno/eddystone/milestones{/number}","notifications_url":"https://api.github.com/repos/g-ortuno/eddystone/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/g-ortuno/eddystone/labels{/name}","releases_url":"https://api.github.com/repos/g-ortuno/eddystone/releases{/id}","created_at":"2015-07-15T22:02:33Z","updated_at":"2015-08-14T21:04:37Z","pushed_at":"2015-08-24T23:25:06Z","git_url":"git://github.com/g-ortuno/eddystone.git","ssh_url":"git@github.com:g-ortuno/eddystone.git","clone_url":"https://github.com/g-ortuno/eddystone.git","svn_url":"https://github.com/g-ortuno/eddystone","homepage":"","size":2293,"stargazers_count":0,"watchers_count":0,"language":"C","has_issues":false,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"g-ortuno:advertising-library","ref":"advertising-library","sha":"0c4cd45971b7953e584b8911925ee035300d1f9e","user":{"login":"g-ortuno","id":3117611,"avatar_url":"https://avatars.githubusercontent.com/u/3117611?v=3","gravatar_id":"","url":"https://api.github.com/users/g-ortuno","html_url":"https://github.com/g-ortuno","followers_url":"https://api.github.com/users/g-ortuno/followers","following_url":"https://api.github.com/users/g-ortuno/following{/other_user}","gists_url":"https://api.github.com/users/g-ortuno/gists{/gist_id}","starred_url":"https://api.github.com/users/g-ortuno/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/g-ortuno/subscriptions","organizations_url":"https://api.github.com/users/g-ortuno/orgs","repos_url":"https://api.github.com/users/g-ortuno/repos","events_url":"https://api.github.com/users/g-ortuno/events{/privacy}","received_events_url":"https://api.github.com/users/g-ortuno/received_events","type":"User","site_admin":false},"repo":{"id":39163427,"name":"eddystone","full_name":"g-ortuno/eddystone","owner":{"login":"g-ortuno","id":3117611,"avatar_url":"https://avatars.githubusercontent.com/u/3117611?v=3","gravatar_id":"","url":"https://api.github.com/users/g-ortuno","html_url":"https://github.com/g-ortuno","followers_url":"https://api.github.com/users/g-ortuno/followers","following_url":"https://api.github.com/users/g-ortuno/following{/other_user}","gists_url":"https://api.github.com/users/g-ortuno/gists{/gist_id}","starred_url":"https://api.github.com/users/g-ortuno/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/g-ortuno/subscriptions","organizations_url":"https://api.github.com/users/g-ortuno/orgs","repos_url":"https://api.github.com/users/g-ortuno/repos","events_url":"https://api.github.com/users/g-ortuno/events{/privacy}","received_events_url":"https://api.github.com/users/g-ortuno/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/g-ortuno/eddystone","description":"Specification for Eddystone, an open beacon format from Google","fork":true,"url":"https://api.github.com/repos/g-ortuno/eddystone","forks_url":"https://api.github.com/repos/g-ortuno/eddystone/forks","keys_url":"https://api.github.com/repos/g-ortuno/eddystone/keys{/key_id}","collaborators_url":"https://api.github.com/repos/g-ortuno/eddystone/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/g-ortuno/eddystone/teams","hooks_url":"https://api.github.com/repos/g-ortuno/eddystone/hooks","issue_events_url":"https://api.github.com/repos/g-ortuno/eddystone/issues/events{/number}","events_url":"https://api.github.com/repos/g-ortuno/eddystone/events","assignees_url":"https://api.github.com/repos/g-ortuno/eddystone/assignees{/user}","branches_url":"https://api.github.com/repos/g-ortuno/eddystone/branches{/branch}","tags_url":"https://api.github.com/repos/g-ortuno/eddystone/tags","blobs_url":"https://api.github.com/repos/g-ortuno/eddystone/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/g-ortuno/eddystone/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/g-ortuno/eddystone/git/refs{/sha}","trees_url":"https://api.github.com/repos/g-ortuno/eddystone/git/trees{/sha}","statuses_url":"https://api.github.com/repos/g-ortuno/eddystone/statuses/{sha}","languages_url":"https://api.github.com/repos/g-ortuno/eddystone/languages","stargazers_url":"https://api.github.com/repos/g-ortuno/eddystone/stargazers","contributors_url":"https://api.github.com/repos/g-ortuno/eddystone/contributors","subscribers_url":"https://api.github.com/repos/g-ortuno/eddystone/subscribers","subscription_url":"https://api.github.com/repos/g-ortuno/eddystone/subscription","commits_url":"https://api.github.com/repos/g-ortuno/eddystone/commits{/sha}","git_commits_url":"https://api.github.com/repos/g-ortuno/eddystone/git/commits{/sha}","comments_url":"https://api.github.com/repos/g-ortuno/eddystone/comments{/number}","issue_comment_url":"https://api.github.com/repos/g-ortuno/eddystone/issues/comments{/number}","contents_url":"https://api.github.com/repos/g-ortuno/eddystone/contents/{+path}","compare_url":"https://api.github.com/repos/g-ortuno/eddystone/compare/{base}...{head}","merges_url":"https://api.github.com/repos/g-ortuno/eddystone/merges","archive_url":"https://api.github.com/repos/g-ortuno/eddystone/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/g-ortuno/eddystone/downloads","issues_url":"https://api.github.com/repos/g-ortuno/eddystone/issues{/number}","pulls_url":"https://api.github.com/repos/g-ortuno/eddystone/pulls{/number}","milestones_url":"https://api.github.com/repos/g-ortuno/eddystone/milestones{/number}","notifications_url":"https://api.github.com/repos/g-ortuno/eddystone/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/g-ortuno/eddystone/labels{/name}","releases_url":"https://api.github.com/repos/g-ortuno/eddystone/releases{/id}","created_at":"2015-07-15T22:02:33Z","updated_at":"2015-08-14T21:04:37Z","pushed_at":"2015-08-24T23:25:06Z","git_url":"git://github.com/g-ortuno/eddystone.git","ssh_url":"git@github.com:g-ortuno/eddystone.git","clone_url":"https://github.com/g-ortuno/eddystone.git","svn_url":"https://github.com/g-ortuno/eddystone","homepage":"","size":2293,"stargazers_count":0,"watchers_count":0,"language":"C","has_issues":false,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/g-ortuno/eddystone/pulls/7"},"html":{"href":"https://github.com/g-ortuno/eddystone/pull/7"},"issue":{"href":"https://api.github.com/repos/g-ortuno/eddystone/issues/7"},"comments":{"href":"https://api.github.com/repos/g-ortuno/eddystone/issues/7/comments"},"review_comments":{"href":"https://api.github.com/repos/g-ortuno/eddystone/pulls/7/comments"},"review_comment":{"href":"https://api.github.com/repos/g-ortuno/eddystone/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/g-ortuno/eddystone/pulls/7/commits"},"statuses":{"href":"https://api.github.com/repos/g-ortuno/eddystone/statuses/04109fbc848d9e442dcbb8d643f7e5936d028996"}}}}