{"action":"created","comment":{"url":"https://api.github.com/repos/Polidea/RxBluetoothKit/pulls/comments/64228049","id":64228049,"diff_hunk":"@@ -0,0 +1,55 @@\n+//\n+//  RestoredState.swift\n+//  RxBluetoothKit\n+//\n+//  Created by Kacper Harasim on 21.05.2016.\n+//  Copyright © 2016 Polidea. All rights reserved.\n+//\n+\n+import Foundation\n+import CoreBluetooth\n+\n+/**\n+ Convenience class which helps reading state of restored BluetoothManager\n+ */\n+public struct RestoredState {\n+\n+    public let restoredStateData: [String:AnyObject]\n+\n+    let bluetoothManager: BluetoothManager\n+    /**\n+     Creates restored state information based on CoreBluetooth's dictionary\n+\n+     - parameter restoredState: Core Bluetooth's restored state data\n+     */\n+    init(restoredStateDictionary: [String:AnyObject], bluetoothManager: BluetoothManager) {\n+        self.restoredStateData = restoredStateDictionary\n+        self.bluetoothManager = bluetoothManager\n+    }\n+\n+    /**\n+     Creates restored state information based on CoreBluetooth's dictionary\n+\n+     - parameter restoredState: Core Bluetooth's restored state data\n+     */\n+    var peripherals: [Peripheral] {\n+        let objects = restoredStateData[CBCentralManagerRestoredStatePeripheralsKey] as? [AnyObject]\n+        guard let arrayOfAnyObjects = objects else { return [] }\n+        return arrayOfAnyObjects.flatMap { $0 as? CBPeripheral }\n+            .map { RxCBPeripheral(peripheral: $0) }\n+            .map { Peripheral(manager: bluetoothManager, peripheral: $0) }\n+    }\n+\n+    var scanOptions: [String : AnyObject]? {\n+        return restoredStateData[CBCentralManagerRestoredStatePeripheralsKey] as? [String : AnyObject]\n+    }\n+\n+    var services: [Service] {","path":"Source/RestoredState.swift","position":47,"original_position":47,"commit_id":"2aa30b224fa5c0190e741efd19dd8611dd3817db","original_commit_id":"2aa30b224fa5c0190e741efd19dd8611dd3817db","user":{"login":"literator","id":242131,"avatar_url":"https://avatars.githubusercontent.com/u/242131?v=3","gravatar_id":"","url":"https://api.github.com/users/literator","html_url":"https://github.com/literator","followers_url":"https://api.github.com/users/literator/followers","following_url":"https://api.github.com/users/literator/following{/other_user}","gists_url":"https://api.github.com/users/literator/gists{/gist_id}","starred_url":"https://api.github.com/users/literator/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/literator/subscriptions","organizations_url":"https://api.github.com/users/literator/orgs","repos_url":"https://api.github.com/users/literator/repos","events_url":"https://api.github.com/users/literator/events{/privacy}","received_events_url":"https://api.github.com/users/literator/received_events","type":"User","site_admin":false},"body":"`public private(set)`?","created_at":"2016-05-23T14:05:56Z","updated_at":"2016-05-23T14:05:56Z","html_url":"https://github.com/Polidea/RxBluetoothKit/pull/27#discussion_r64228049","pull_request_url":"https://api.github.com/repos/Polidea/RxBluetoothKit/pulls/27","_links":{"self":{"href":"https://api.github.com/repos/Polidea/RxBluetoothKit/pulls/comments/64228049"},"html":{"href":"https://github.com/Polidea/RxBluetoothKit/pull/27#discussion_r64228049"},"pull_request":{"href":"https://api.github.com/repos/Polidea/RxBluetoothKit/pulls/27"}}},"pull_request":{"url":"https://api.github.com/repos/Polidea/RxBluetoothKit/pulls/27","id":71045594,"html_url":"https://github.com/Polidea/RxBluetoothKit/pull/27","diff_url":"https://github.com/Polidea/RxBluetoothKit/pull/27.diff","patch_url":"https://github.com/Polidea/RxBluetoothKit/pull/27.patch","issue_url":"https://api.github.com/repos/Polidea/RxBluetoothKit/issues/27","number":27,"state":"open","locked":false,"title":"Feature/state restoration","user":{"login":"Kacper20","id":6010341,"avatar_url":"https://avatars.githubusercontent.com/u/6010341?v=3","gravatar_id":"","url":"https://api.github.com/users/Kacper20","html_url":"https://github.com/Kacper20","followers_url":"https://api.github.com/users/Kacper20/followers","following_url":"https://api.github.com/users/Kacper20/following{/other_user}","gists_url":"https://api.github.com/users/Kacper20/gists{/gist_id}","starred_url":"https://api.github.com/users/Kacper20/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Kacper20/subscriptions","organizations_url":"https://api.github.com/users/Kacper20/orgs","repos_url":"https://api.github.com/users/Kacper20/repos","events_url":"https://api.github.com/users/Kacper20/events{/privacy}","received_events_url":"https://api.github.com/users/Kacper20/received_events","type":"User","site_admin":false},"body":"Hi,\r\n\r\nIt's first look at implementation. Waiting for comments & improve suggestions. Later we'll document it.","created_at":"2016-05-23T11:28:46Z","updated_at":"2016-05-23T14:05:56Z","closed_at":null,"merged_at":null,"merge_commit_sha":"fcc07775082dc9d34f065860ab3620de6686ff6f","assignee":{"login":"literator","id":242131,"avatar_url":"https://avatars.githubusercontent.com/u/242131?v=3","gravatar_id":"","url":"https://api.github.com/users/literator","html_url":"https://github.com/literator","followers_url":"https://api.github.com/users/literator/followers","following_url":"https://api.github.com/users/literator/following{/other_user}","gists_url":"https://api.github.com/users/literator/gists{/gist_id}","starred_url":"https://api.github.com/users/literator/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/literator/subscriptions","organizations_url":"https://api.github.com/users/literator/orgs","repos_url":"https://api.github.com/users/literator/repos","events_url":"https://api.github.com/users/literator/events{/privacy}","received_events_url":"https://api.github.com/users/literator/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/Polidea/RxBluetoothKit/pulls/27/commits","review_comments_url":"https://api.github.com/repos/Polidea/RxBluetoothKit/pulls/27/comments","review_comment_url":"https://api.github.com/repos/Polidea/RxBluetoothKit/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Polidea/RxBluetoothKit/issues/27/comments","statuses_url":"https://api.github.com/repos/Polidea/RxBluetoothKit/statuses/2aa30b224fa5c0190e741efd19dd8611dd3817db","head":{"label":"Polidea:feature/state_restoration","ref":"feature/state_restoration","sha":"2aa30b224fa5c0190e741efd19dd8611dd3817db","user":{"login":"Polidea","id":1611150,"avatar_url":"https://avatars.githubusercontent.com/u/1611150?v=3","gravatar_id":"","url":"https://api.github.com/users/Polidea","html_url":"https://github.com/Polidea","followers_url":"https://api.github.com/users/Polidea/followers","following_url":"https://api.github.com/users/Polidea/following{/other_user}","gists_url":"https://api.github.com/users/Polidea/gists{/gist_id}","starred_url":"https://api.github.com/users/Polidea/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Polidea/subscriptions","organizations_url":"https://api.github.com/users/Polidea/orgs","repos_url":"https://api.github.com/users/Polidea/repos","events_url":"https://api.github.com/users/Polidea/events{/privacy}","received_events_url":"https://api.github.com/users/Polidea/received_events","type":"Organization","site_admin":false},"repo":{"id":55787235,"name":"RxBluetoothKit","full_name":"Polidea/RxBluetoothKit","owner":{"login":"Polidea","id":1611150,"avatar_url":"https://avatars.githubusercontent.com/u/1611150?v=3","gravatar_id":"","url":"https://api.github.com/users/Polidea","html_url":"https://github.com/Polidea","followers_url":"https://api.github.com/users/Polidea/followers","following_url":"https://api.github.com/users/Polidea/following{/other_user}","gists_url":"https://api.github.com/users/Polidea/gists{/gist_id}","starred_url":"https://api.github.com/users/Polidea/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Polidea/subscriptions","organizations_url":"https://api.github.com/users/Polidea/orgs","repos_url":"https://api.github.com/users/Polidea/repos","events_url":"https://api.github.com/users/Polidea/events{/privacy}","received_events_url":"https://api.github.com/users/Polidea/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Polidea/RxBluetoothKit","description":"iOS & OSX Bluetooth library for RxSwift","fork":false,"url":"https://api.github.com/repos/Polidea/RxBluetoothKit","forks_url":"https://api.github.com/repos/Polidea/RxBluetoothKit/forks","keys_url":"https://api.github.com/repos/Polidea/RxBluetoothKit/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Polidea/RxBluetoothKit/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Polidea/RxBluetoothKit/teams","hooks_url":"https://api.github.com/repos/Polidea/RxBluetoothKit/hooks","issue_events_url":"https://api.github.com/repos/Polidea/RxBluetoothKit/issues/events{/number}","events_url":"https://api.github.com/repos/Polidea/RxBluetoothKit/events","assignees_url":"https://api.github.com/repos/Polidea/RxBluetoothKit/assignees{/user}","branches_url":"https://api.github.com/repos/Polidea/RxBluetoothKit/branches{/branch}","tags_url":"https://api.github.com/repos/Polidea/RxBluetoothKit/tags","blobs_url":"https://api.github.com/repos/Polidea/RxBluetoothKit/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Polidea/RxBluetoothKit/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Polidea/RxBluetoothKit/git/refs{/sha}","trees_url":"https://api.github.com/repos/Polidea/RxBluetoothKit/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Polidea/RxBluetoothKit/statuses/{sha}","languages_url":"https://api.github.com/repos/Polidea/RxBluetoothKit/languages","stargazers_url":"https://api.github.com/repos/Polidea/RxBluetoothKit/stargazers","contributors_url":"https://api.github.com/repos/Polidea/RxBluetoothKit/contributors","subscribers_url":"https://api.github.com/repos/Polidea/RxBluetoothKit/subscribers","subscription_url":"https://api.github.com/repos/Polidea/RxBluetoothKit/subscription","commits_url":"https://api.github.com/repos/Polidea/RxBluetoothKit/commits{/sha}","git_commits_url":"https://api.github.com/repos/Polidea/RxBluetoothKit/git/commits{/sha}","comments_url":"https://api.github.com/repos/Polidea/RxBluetoothKit/comments{/number}","issue_comment_url":"https://api.github.com/repos/Polidea/RxBluetoothKit/issues/comments{/number}","contents_url":"https://api.github.com/repos/Polidea/RxBluetoothKit/contents/{+path}","compare_url":"https://api.github.com/repos/Polidea/RxBluetoothKit/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Polidea/RxBluetoothKit/merges","archive_url":"https://api.github.com/repos/Polidea/RxBluetoothKit/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Polidea/RxBluetoothKit/downloads","issues_url":"https://api.github.com/repos/Polidea/RxBluetoothKit/issues{/number}","pulls_url":"https://api.github.com/repos/Polidea/RxBluetoothKit/pulls{/number}","milestones_url":"https://api.github.com/repos/Polidea/RxBluetoothKit/milestones{/number}","notifications_url":"https://api.github.com/repos/Polidea/RxBluetoothKit/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Polidea/RxBluetoothKit/labels{/name}","releases_url":"https://api.github.com/repos/Polidea/RxBluetoothKit/releases{/id}","deployments_url":"https://api.github.com/repos/Polidea/RxBluetoothKit/deployments","created_at":"2016-04-08T14:57:55Z","updated_at":"2016-05-23T09:10:19Z","pushed_at":"2016-05-23T11:28:46Z","git_url":"git://github.com/Polidea/RxBluetoothKit.git","ssh_url":"git@github.com:Polidea/RxBluetoothKit.git","clone_url":"https://github.com/Polidea/RxBluetoothKit.git","svn_url":"https://github.com/Polidea/RxBluetoothKit","homepage":"","size":759,"stargazers_count":328,"watchers_count":328,"language":"Swift","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":13,"mirror_url":null,"open_issues_count":5,"forks":13,"open_issues":5,"watchers":328,"default_branch":"master"}},"base":{"label":"Polidea:develop","ref":"develop","sha":"4b6787fe152ac4986600d49885670e7033f2cba1","user":{"login":"Polidea","id":1611150,"avatar_url":"https://avatars.githubusercontent.com/u/1611150?v=3","gravatar_id":"","url":"https://api.github.com/users/Polidea","html_url":"https://github.com/Polidea","followers_url":"https://api.github.com/users/Polidea/followers","following_url":"https://api.github.com/users/Polidea/following{/other_user}","gists_url":"https://api.github.com/users/Polidea/gists{/gist_id}","starred_url":"https://api.github.com/users/Polidea/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Polidea/subscriptions","organizations_url":"https://api.github.com/users/Polidea/orgs","repos_url":"https://api.github.com/users/Polidea/repos","events_url":"https://api.github.com/users/Polidea/events{/privacy}","received_events_url":"https://api.github.com/users/Polidea/received_events","type":"Organization","site_admin":false},"repo":{"id":55787235,"name":"RxBluetoothKit","full_name":"Polidea/RxBluetoothKit","owner":{"login":"Polidea","id":1611150,"avatar_url":"https://avatars.githubusercontent.com/u/1611150?v=3","gravatar_id":"","url":"https://api.github.com/users/Polidea","html_url":"https://github.com/Polidea","followers_url":"https://api.github.com/users/Polidea/followers","following_url":"https://api.github.com/users/Polidea/following{/other_user}","gists_url":"https://api.github.com/users/Polidea/gists{/gist_id}","starred_url":"https://api.github.com/users/Polidea/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Polidea/subscriptions","organizations_url":"https://api.github.com/users/Polidea/orgs","repos_url":"https://api.github.com/users/Polidea/repos","events_url":"https://api.github.com/users/Polidea/events{/privacy}","received_events_url":"https://api.github.com/users/Polidea/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Polidea/RxBluetoothKit","description":"iOS & OSX Bluetooth library for RxSwift","fork":false,"url":"https://api.github.com/repos/Polidea/RxBluetoothKit","forks_url":"https://api.github.com/repos/Polidea/RxBluetoothKit/forks","keys_url":"https://api.github.com/repos/Polidea/RxBluetoothKit/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Polidea/RxBluetoothKit/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Polidea/RxBluetoothKit/teams","hooks_url":"https://api.github.com/repos/Polidea/RxBluetoothKit/hooks","issue_events_url":"https://api.github.com/repos/Polidea/RxBluetoothKit/issues/events{/number}","events_url":"https://api.github.com/repos/Polidea/RxBluetoothKit/events","assignees_url":"https://api.github.com/repos/Polidea/RxBluetoothKit/assignees{/user}","branches_url":"https://api.github.com/repos/Polidea/RxBluetoothKit/branches{/branch}","tags_url":"https://api.github.com/repos/Polidea/RxBluetoothKit/tags","blobs_url":"https://api.github.com/repos/Polidea/RxBluetoothKit/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Polidea/RxBluetoothKit/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Polidea/RxBluetoothKit/git/refs{/sha}","trees_url":"https://api.github.com/repos/Polidea/RxBluetoothKit/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Polidea/RxBluetoothKit/statuses/{sha}","languages_url":"https://api.github.com/repos/Polidea/RxBluetoothKit/languages","stargazers_url":"https://api.github.com/repos/Polidea/RxBluetoothKit/stargazers","contributors_url":"https://api.github.com/repos/Polidea/RxBluetoothKit/contributors","subscribers_url":"https://api.github.com/repos/Polidea/RxBluetoothKit/subscribers","subscription_url":"https://api.github.com/repos/Polidea/RxBluetoothKit/subscription","commits_url":"https://api.github.com/repos/Polidea/RxBluetoothKit/commits{/sha}","git_commits_url":"https://api.github.com/repos/Polidea/RxBluetoothKit/git/commits{/sha}","comments_url":"https://api.github.com/repos/Polidea/RxBluetoothKit/comments{/number}","issue_comment_url":"https://api.github.com/repos/Polidea/RxBluetoothKit/issues/comments{/number}","contents_url":"https://api.github.com/repos/Polidea/RxBluetoothKit/contents/{+path}","compare_url":"https://api.github.com/repos/Polidea/RxBluetoothKit/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Polidea/RxBluetoothKit/merges","archive_url":"https://api.github.com/repos/Polidea/RxBluetoothKit/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Polidea/RxBluetoothKit/downloads","issues_url":"https://api.github.com/repos/Polidea/RxBluetoothKit/issues{/number}","pulls_url":"https://api.github.com/repos/Polidea/RxBluetoothKit/pulls{/number}","milestones_url":"https://api.github.com/repos/Polidea/RxBluetoothKit/milestones{/number}","notifications_url":"https://api.github.com/repos/Polidea/RxBluetoothKit/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Polidea/RxBluetoothKit/labels{/name}","releases_url":"https://api.github.com/repos/Polidea/RxBluetoothKit/releases{/id}","deployments_url":"https://api.github.com/repos/Polidea/RxBluetoothKit/deployments","created_at":"2016-04-08T14:57:55Z","updated_at":"2016-05-23T09:10:19Z","pushed_at":"2016-05-23T11:28:46Z","git_url":"git://github.com/Polidea/RxBluetoothKit.git","ssh_url":"git@github.com:Polidea/RxBluetoothKit.git","clone_url":"https://github.com/Polidea/RxBluetoothKit.git","svn_url":"https://github.com/Polidea/RxBluetoothKit","homepage":"","size":759,"stargazers_count":328,"watchers_count":328,"language":"Swift","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":13,"mirror_url":null,"open_issues_count":5,"forks":13,"open_issues":5,"watchers":328,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Polidea/RxBluetoothKit/pulls/27"},"html":{"href":"https://github.com/Polidea/RxBluetoothKit/pull/27"},"issue":{"href":"https://api.github.com/repos/Polidea/RxBluetoothKit/issues/27"},"comments":{"href":"https://api.github.com/repos/Polidea/RxBluetoothKit/issues/27/comments"},"review_comments":{"href":"https://api.github.com/repos/Polidea/RxBluetoothKit/pulls/27/comments"},"review_comment":{"href":"https://api.github.com/repos/Polidea/RxBluetoothKit/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Polidea/RxBluetoothKit/pulls/27/commits"},"statuses":{"href":"https://api.github.com/repos/Polidea/RxBluetoothKit/statuses/2aa30b224fa5c0190e741efd19dd8611dd3817db"}}}}
{"actor":{"display_login":"literator"}}