{"action":"created","comment":{"url":"https://api.github.com/repos/Euraldius/lunchbot/pulls/comments/24511620","id":24511620,"diff_hunk":"@@ -0,0 +1,13 @@\n+struct Thoughtbot {\n+    let offices: Array<AnyObject> = []\n+\n+    init() {\n+        if let officesData = JSONData.load(\"offices\") as? [AnyObject] {\n+            for officeData in officesData {","path":"lunchbot/Models/Thoughtbot.swift","position":6,"original_position":6,"commit_id":"2a1c041aa114b00dab2ba9cd13cb1254c2931032","original_commit_id":"2a1c041aa114b00dab2ba9cd13cb1254c2931032","user":{"login":"gfontenot","id":124499,"avatar_url":"https://avatars.githubusercontent.com/u/124499?v=3","gravatar_id":"","url":"https://api.github.com/users/gfontenot","html_url":"https://github.com/gfontenot","followers_url":"https://api.github.com/users/gfontenot/followers","following_url":"https://api.github.com/users/gfontenot/following{/other_user}","gists_url":"https://api.github.com/users/gfontenot/gists{/gist_id}","starred_url":"https://api.github.com/users/gfontenot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gfontenot/subscriptions","organizations_url":"https://api.github.com/users/gfontenot/orgs","repos_url":"https://api.github.com/users/gfontenot/repos","events_url":"https://api.github.com/users/gfontenot/events{/privacy}","received_events_url":"https://api.github.com/users/gfontenot/received_events","type":"User","site_admin":false},"body":"This is `map`! I'd probably tackle this in 2 steps:\r\n\r\n```swift\r\nlet officesData = JSONData.load(\"offices\") as? [AnyObject] ?? []\r\noffices = officesData.map { ThoughtbotOffice.decode($0 as [String: AnyObject]) }\r\n```\r\n\r\nThis will be better, since you won't have to have the default value that I mentioned above. It will also mean that this code will be future proof for Swift 1.2, where this kind of special mutation of constants inside `init` is disallowed.\r\n\r\nSide note: should `offices` be of the type `[ThoughtbotOffice]`?","created_at":"2015-02-11T17:01:30Z","updated_at":"2015-02-11T17:01:30Z","html_url":"https://github.com/Euraldius/lunchbot/pull/4#discussion_r24511620","pull_request_url":"https://api.github.com/repos/Euraldius/lunchbot/pulls/4","_links":{"self":{"href":"https://api.github.com/repos/Euraldius/lunchbot/pulls/comments/24511620"},"html":{"href":"https://github.com/Euraldius/lunchbot/pull/4#discussion_r24511620"},"pull_request":{"href":"https://api.github.com/repos/Euraldius/lunchbot/pulls/4"}}},"pull_request":{"url":"https://api.github.com/repos/Euraldius/lunchbot/pulls/4","id":29100427,"html_url":"https://github.com/Euraldius/lunchbot/pull/4","diff_url":"https://github.com/Euraldius/lunchbot/pull/4.diff","patch_url":"https://github.com/Euraldius/lunchbot/pull/4.patch","issue_url":"https://api.github.com/repos/Euraldius/lunchbot/issues/4","number":4,"state":"open","locked":false,"title":"Add thoughtbot offices to map","user":{"login":"Euraldius","id":3631793,"avatar_url":"https://avatars.githubusercontent.com/u/3631793?v=3","gravatar_id":"","url":"https://api.github.com/users/Euraldius","html_url":"https://github.com/Euraldius","followers_url":"https://api.github.com/users/Euraldius/followers","following_url":"https://api.github.com/users/Euraldius/following{/other_user}","gists_url":"https://api.github.com/users/Euraldius/gists{/gist_id}","starred_url":"https://api.github.com/users/Euraldius/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Euraldius/subscriptions","organizations_url":"https://api.github.com/users/Euraldius/orgs","repos_url":"https://api.github.com/users/Euraldius/repos","events_url":"https://api.github.com/users/Euraldius/events{/privacy}","received_events_url":"https://api.github.com/users/Euraldius/received_events","type":"User","site_admin":false},"body":"Upon the map view loading, a marker is placed on the map denoting the location of each thoughtbot office.\r\n\r\n#swift","created_at":"2015-02-11T15:37:04Z","updated_at":"2015-02-11T17:01:30Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d76e7f2acf695b209e88170190f0510ad5eb12f6","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Euraldius/lunchbot/pulls/4/commits","review_comments_url":"https://api.github.com/repos/Euraldius/lunchbot/pulls/4/comments","review_comment_url":"https://api.github.com/repos/Euraldius/lunchbot/pulls/comments/{number}","comments_url":"https://api.github.com/repos/Euraldius/lunchbot/issues/4/comments","statuses_url":"https://api.github.com/repos/Euraldius/lunchbot/statuses/2a1c041aa114b00dab2ba9cd13cb1254c2931032","head":{"label":"Euraldius:ag-thoughtbot-offices","ref":"ag-thoughtbot-offices","sha":"2a1c041aa114b00dab2ba9cd13cb1254c2931032","user":{"login":"Euraldius","id":3631793,"avatar_url":"https://avatars.githubusercontent.com/u/3631793?v=3","gravatar_id":"","url":"https://api.github.com/users/Euraldius","html_url":"https://github.com/Euraldius","followers_url":"https://api.github.com/users/Euraldius/followers","following_url":"https://api.github.com/users/Euraldius/following{/other_user}","gists_url":"https://api.github.com/users/Euraldius/gists{/gist_id}","starred_url":"https://api.github.com/users/Euraldius/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Euraldius/subscriptions","organizations_url":"https://api.github.com/users/Euraldius/orgs","repos_url":"https://api.github.com/users/Euraldius/repos","events_url":"https://api.github.com/users/Euraldius/events{/privacy}","received_events_url":"https://api.github.com/users/Euraldius/received_events","type":"User","site_admin":false},"repo":{"id":30362213,"name":"lunchbot","full_name":"Euraldius/lunchbot","owner":{"login":"Euraldius","id":3631793,"avatar_url":"https://avatars.githubusercontent.com/u/3631793?v=3","gravatar_id":"","url":"https://api.github.com/users/Euraldius","html_url":"https://github.com/Euraldius","followers_url":"https://api.github.com/users/Euraldius/followers","following_url":"https://api.github.com/users/Euraldius/following{/other_user}","gists_url":"https://api.github.com/users/Euraldius/gists{/gist_id}","starred_url":"https://api.github.com/users/Euraldius/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Euraldius/subscriptions","organizations_url":"https://api.github.com/users/Euraldius/orgs","repos_url":"https://api.github.com/users/Euraldius/repos","events_url":"https://api.github.com/users/Euraldius/events{/privacy}","received_events_url":"https://api.github.com/users/Euraldius/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Euraldius/lunchbot","description":"A lunch place finding app for thoughtbot employees","fork":false,"url":"https://api.github.com/repos/Euraldius/lunchbot","forks_url":"https://api.github.com/repos/Euraldius/lunchbot/forks","keys_url":"https://api.github.com/repos/Euraldius/lunchbot/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Euraldius/lunchbot/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Euraldius/lunchbot/teams","hooks_url":"https://api.github.com/repos/Euraldius/lunchbot/hooks","issue_events_url":"https://api.github.com/repos/Euraldius/lunchbot/issues/events{/number}","events_url":"https://api.github.com/repos/Euraldius/lunchbot/events","assignees_url":"https://api.github.com/repos/Euraldius/lunchbot/assignees{/user}","branches_url":"https://api.github.com/repos/Euraldius/lunchbot/branches{/branch}","tags_url":"https://api.github.com/repos/Euraldius/lunchbot/tags","blobs_url":"https://api.github.com/repos/Euraldius/lunchbot/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Euraldius/lunchbot/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Euraldius/lunchbot/git/refs{/sha}","trees_url":"https://api.github.com/repos/Euraldius/lunchbot/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Euraldius/lunchbot/statuses/{sha}","languages_url":"https://api.github.com/repos/Euraldius/lunchbot/languages","stargazers_url":"https://api.github.com/repos/Euraldius/lunchbot/stargazers","contributors_url":"https://api.github.com/repos/Euraldius/lunchbot/contributors","subscribers_url":"https://api.github.com/repos/Euraldius/lunchbot/subscribers","subscription_url":"https://api.github.com/repos/Euraldius/lunchbot/subscription","commits_url":"https://api.github.com/repos/Euraldius/lunchbot/commits{/sha}","git_commits_url":"https://api.github.com/repos/Euraldius/lunchbot/git/commits{/sha}","comments_url":"https://api.github.com/repos/Euraldius/lunchbot/comments{/number}","issue_comment_url":"https://api.github.com/repos/Euraldius/lunchbot/issues/comments/{number}","contents_url":"https://api.github.com/repos/Euraldius/lunchbot/contents/{+path}","compare_url":"https://api.github.com/repos/Euraldius/lunchbot/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Euraldius/lunchbot/merges","archive_url":"https://api.github.com/repos/Euraldius/lunchbot/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Euraldius/lunchbot/downloads","issues_url":"https://api.github.com/repos/Euraldius/lunchbot/issues{/number}","pulls_url":"https://api.github.com/repos/Euraldius/lunchbot/pulls{/number}","milestones_url":"https://api.github.com/repos/Euraldius/lunchbot/milestones{/number}","notifications_url":"https://api.github.com/repos/Euraldius/lunchbot/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Euraldius/lunchbot/labels{/name}","releases_url":"https://api.github.com/repos/Euraldius/lunchbot/releases{/id}","created_at":"2015-02-05T15:24:23Z","updated_at":"2015-02-09T22:09:26Z","pushed_at":"2015-02-11T15:41:27Z","git_url":"git://github.com/Euraldius/lunchbot.git","ssh_url":"git@github.com:Euraldius/lunchbot.git","clone_url":"https://github.com/Euraldius/lunchbot.git","svn_url":"https://github.com/Euraldius/lunchbot","homepage":null,"size":0,"stargazers_count":0,"watchers_count":0,"language":"Objective-C","has_issues":true,"has_downloads":true,"has_wiki":true,"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":"Euraldius:master","ref":"master","sha":"00e29aee56b7de52a5bde327533d9f29fd7fb679","user":{"login":"Euraldius","id":3631793,"avatar_url":"https://avatars.githubusercontent.com/u/3631793?v=3","gravatar_id":"","url":"https://api.github.com/users/Euraldius","html_url":"https://github.com/Euraldius","followers_url":"https://api.github.com/users/Euraldius/followers","following_url":"https://api.github.com/users/Euraldius/following{/other_user}","gists_url":"https://api.github.com/users/Euraldius/gists{/gist_id}","starred_url":"https://api.github.com/users/Euraldius/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Euraldius/subscriptions","organizations_url":"https://api.github.com/users/Euraldius/orgs","repos_url":"https://api.github.com/users/Euraldius/repos","events_url":"https://api.github.com/users/Euraldius/events{/privacy}","received_events_url":"https://api.github.com/users/Euraldius/received_events","type":"User","site_admin":false},"repo":{"id":30362213,"name":"lunchbot","full_name":"Euraldius/lunchbot","owner":{"login":"Euraldius","id":3631793,"avatar_url":"https://avatars.githubusercontent.com/u/3631793?v=3","gravatar_id":"","url":"https://api.github.com/users/Euraldius","html_url":"https://github.com/Euraldius","followers_url":"https://api.github.com/users/Euraldius/followers","following_url":"https://api.github.com/users/Euraldius/following{/other_user}","gists_url":"https://api.github.com/users/Euraldius/gists{/gist_id}","starred_url":"https://api.github.com/users/Euraldius/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Euraldius/subscriptions","organizations_url":"https://api.github.com/users/Euraldius/orgs","repos_url":"https://api.github.com/users/Euraldius/repos","events_url":"https://api.github.com/users/Euraldius/events{/privacy}","received_events_url":"https://api.github.com/users/Euraldius/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Euraldius/lunchbot","description":"A lunch place finding app for thoughtbot employees","fork":false,"url":"https://api.github.com/repos/Euraldius/lunchbot","forks_url":"https://api.github.com/repos/Euraldius/lunchbot/forks","keys_url":"https://api.github.com/repos/Euraldius/lunchbot/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Euraldius/lunchbot/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Euraldius/lunchbot/teams","hooks_url":"https://api.github.com/repos/Euraldius/lunchbot/hooks","issue_events_url":"https://api.github.com/repos/Euraldius/lunchbot/issues/events{/number}","events_url":"https://api.github.com/repos/Euraldius/lunchbot/events","assignees_url":"https://api.github.com/repos/Euraldius/lunchbot/assignees{/user}","branches_url":"https://api.github.com/repos/Euraldius/lunchbot/branches{/branch}","tags_url":"https://api.github.com/repos/Euraldius/lunchbot/tags","blobs_url":"https://api.github.com/repos/Euraldius/lunchbot/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Euraldius/lunchbot/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Euraldius/lunchbot/git/refs{/sha}","trees_url":"https://api.github.com/repos/Euraldius/lunchbot/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Euraldius/lunchbot/statuses/{sha}","languages_url":"https://api.github.com/repos/Euraldius/lunchbot/languages","stargazers_url":"https://api.github.com/repos/Euraldius/lunchbot/stargazers","contributors_url":"https://api.github.com/repos/Euraldius/lunchbot/contributors","subscribers_url":"https://api.github.com/repos/Euraldius/lunchbot/subscribers","subscription_url":"https://api.github.com/repos/Euraldius/lunchbot/subscription","commits_url":"https://api.github.com/repos/Euraldius/lunchbot/commits{/sha}","git_commits_url":"https://api.github.com/repos/Euraldius/lunchbot/git/commits{/sha}","comments_url":"https://api.github.com/repos/Euraldius/lunchbot/comments{/number}","issue_comment_url":"https://api.github.com/repos/Euraldius/lunchbot/issues/comments/{number}","contents_url":"https://api.github.com/repos/Euraldius/lunchbot/contents/{+path}","compare_url":"https://api.github.com/repos/Euraldius/lunchbot/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Euraldius/lunchbot/merges","archive_url":"https://api.github.com/repos/Euraldius/lunchbot/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Euraldius/lunchbot/downloads","issues_url":"https://api.github.com/repos/Euraldius/lunchbot/issues{/number}","pulls_url":"https://api.github.com/repos/Euraldius/lunchbot/pulls{/number}","milestones_url":"https://api.github.com/repos/Euraldius/lunchbot/milestones{/number}","notifications_url":"https://api.github.com/repos/Euraldius/lunchbot/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Euraldius/lunchbot/labels{/name}","releases_url":"https://api.github.com/repos/Euraldius/lunchbot/releases{/id}","created_at":"2015-02-05T15:24:23Z","updated_at":"2015-02-09T22:09:26Z","pushed_at":"2015-02-11T15:41:27Z","git_url":"git://github.com/Euraldius/lunchbot.git","ssh_url":"git@github.com:Euraldius/lunchbot.git","clone_url":"https://github.com/Euraldius/lunchbot.git","svn_url":"https://github.com/Euraldius/lunchbot","homepage":null,"size":0,"stargazers_count":0,"watchers_count":0,"language":"Objective-C","has_issues":true,"has_downloads":true,"has_wiki":true,"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/Euraldius/lunchbot/pulls/4"},"html":{"href":"https://github.com/Euraldius/lunchbot/pull/4"},"issue":{"href":"https://api.github.com/repos/Euraldius/lunchbot/issues/4"},"comments":{"href":"https://api.github.com/repos/Euraldius/lunchbot/issues/4/comments"},"review_comments":{"href":"https://api.github.com/repos/Euraldius/lunchbot/pulls/4/comments"},"review_comment":{"href":"https://api.github.com/repos/Euraldius/lunchbot/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/Euraldius/lunchbot/pulls/4/commits"},"statuses":{"href":"https://api.github.com/repos/Euraldius/lunchbot/statuses/2a1c041aa114b00dab2ba9cd13cb1254c2931032"}}}}