{"action":"created","comment":{"url":"https://api.github.com/repos/BlockScore/blockscore-ruby/pulls/comments/39232592","id":39232592,"diff_hunk":"@@ -0,0 +1,100 @@\n+module BlockScore\n+  class Collection\n+    # Member of a {Collection} class\n+    class Member < SimpleDelegator\n+      # Initialize a new member\n+      #\n+      # @param parent [BlockScore::Base] parent resource\n+      # @param instance [BlockScore::Base] member instance\n+      #\n+      # @return [undefined]\n+      #\n+      # @api private\n+      def initialize(parent, instance)\n+        @instance = instance\n+        @parent = parent\n+\n+        super(instance)\n+      end\n+\n+      # Save parent, set parent id, and save instance\n+      #\n+      # @example\n+      #   # saves both unsaved person and unsaved question_set\n+      #   person = Person.new(attributes)\n+      #   question_set = QuestionSet.new\n+      #   Member.new(person, question_set).save\n+      #\n+      # @return return value of instance `#save`\n+      #\n+      # @api public\n+      def save\n+        save_parent\n+        send(:\"#{parent_name}_id=\", parent.id)\n+        result = instance.save\n+        ids.push(instance.id) unless ids.include?(instance.id)\n+        result\n+      end\n+\n+      private\n+\n+      # Name of parent resource\n+      #\n+      # @example\n+      #   self.parent_name # => 'person'\n+      #\n+      # @return [String]\n+      #\n+      # @api private\n+      def parent_name\n+        parent.class.resource\n+      end\n+\n+      # Save parent if it hasn't already been saved\n+      #\n+      # @return return of parent.save if previously unsaved\n+      # @return nil otherwise\n+      #\n+      # @api private\n+      def save_parent\n+        parent.save unless parent_saved?\n+      end\n+\n+      # Check if parent is saved\n+      #\n+      # @return [Boolean]","path":"lib/blockscore/collection/member.rb","position":65,"original_position":65,"commit_id":"999a725638dbac8b796e6ce984c78ae0ca119e1c","original_commit_id":"999a725638dbac8b796e6ce984c78ae0ca119e1c","user":{"login":"backus","id":2085622,"avatar_url":"https://avatars.githubusercontent.com/u/2085622?v=3","gravatar_id":"","url":"https://api.github.com/users/backus","html_url":"https://github.com/backus","followers_url":"https://api.github.com/users/backus/followers","following_url":"https://api.github.com/users/backus/following{/other_user}","gists_url":"https://api.github.com/users/backus/gists{/gist_id}","starred_url":"https://api.github.com/users/backus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/backus/subscriptions","organizations_url":"https://api.github.com/users/backus/orgs","repos_url":"https://api.github.com/users/backus/repos","events_url":"https://api.github.com/users/backus/events{/privacy}","received_events_url":"https://api.github.com/users/backus/received_events","type":"User","site_admin":false},"body":"I just left this comment mainly to remind myself since I introduced this.  Just the comment.  Doesn't return a boolean it returns nil or a string","created_at":"2015-09-11T01:01:24Z","updated_at":"2015-09-11T01:01:24Z","html_url":"https://github.com/BlockScore/blockscore-ruby/pull/23#discussion_r39232592","pull_request_url":"https://api.github.com/repos/BlockScore/blockscore-ruby/pulls/23","_links":{"self":{"href":"https://api.github.com/repos/BlockScore/blockscore-ruby/pulls/comments/39232592"},"html":{"href":"https://github.com/BlockScore/blockscore-ruby/pull/23#discussion_r39232592"},"pull_request":{"href":"https://api.github.com/repos/BlockScore/blockscore-ruby/pulls/23"}}},"pull_request":{"url":"https://api.github.com/repos/BlockScore/blockscore-ruby/pulls/23","id":43114304,"html_url":"https://github.com/BlockScore/blockscore-ruby/pull/23","diff_url":"https://github.com/BlockScore/blockscore-ruby/pull/23.diff","patch_url":"https://github.com/BlockScore/blockscore-ruby/pull/23.patch","issue_url":"https://api.github.com/repos/BlockScore/blockscore-ruby/issues/23","number":23,"state":"open","locked":false,"title":"Fix/person question sets array","user":{"login":"backus","id":2085622,"avatar_url":"https://avatars.githubusercontent.com/u/2085622?v=3","gravatar_id":"","url":"https://api.github.com/users/backus","html_url":"https://github.com/backus","followers_url":"https://api.github.com/users/backus/followers","following_url":"https://api.github.com/users/backus/following{/other_user}","gists_url":"https://api.github.com/users/backus/gists{/gist_id}","starred_url":"https://api.github.com/users/backus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/backus/subscriptions","organizations_url":"https://api.github.com/users/backus/orgs","repos_url":"https://api.github.com/users/backus/repos","events_url":"https://api.github.com/users/backus/events{/privacy}","received_events_url":"https://api.github.com/users/backus/received_events","type":"User","site_admin":false},"body":"Failing test for issue mentioned in #22.  Good to go @DelmerGA ","created_at":"2015-08-23T02:35:19Z","updated_at":"2015-09-11T01:01:24Z","closed_at":null,"merged_at":null,"merge_commit_sha":"52749859541ef407af26947182b51eb57331823e","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/BlockScore/blockscore-ruby/pulls/23/commits","review_comments_url":"https://api.github.com/repos/BlockScore/blockscore-ruby/pulls/23/comments","review_comment_url":"https://api.github.com/repos/BlockScore/blockscore-ruby/pulls/comments{/number}","comments_url":"https://api.github.com/repos/BlockScore/blockscore-ruby/issues/23/comments","statuses_url":"https://api.github.com/repos/BlockScore/blockscore-ruby/statuses/999a725638dbac8b796e6ce984c78ae0ca119e1c","head":{"label":"BlockScore:fix/person-question_sets-array","ref":"fix/person-question_sets-array","sha":"999a725638dbac8b796e6ce984c78ae0ca119e1c","user":{"login":"BlockScore","id":4524125,"avatar_url":"https://avatars.githubusercontent.com/u/4524125?v=3","gravatar_id":"","url":"https://api.github.com/users/BlockScore","html_url":"https://github.com/BlockScore","followers_url":"https://api.github.com/users/BlockScore/followers","following_url":"https://api.github.com/users/BlockScore/following{/other_user}","gists_url":"https://api.github.com/users/BlockScore/gists{/gist_id}","starred_url":"https://api.github.com/users/BlockScore/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BlockScore/subscriptions","organizations_url":"https://api.github.com/users/BlockScore/orgs","repos_url":"https://api.github.com/users/BlockScore/repos","events_url":"https://api.github.com/users/BlockScore/events{/privacy}","received_events_url":"https://api.github.com/users/BlockScore/received_events","type":"Organization","site_admin":false},"repo":{"id":17101801,"name":"blockscore-ruby","full_name":"BlockScore/blockscore-ruby","owner":{"login":"BlockScore","id":4524125,"avatar_url":"https://avatars.githubusercontent.com/u/4524125?v=3","gravatar_id":"","url":"https://api.github.com/users/BlockScore","html_url":"https://github.com/BlockScore","followers_url":"https://api.github.com/users/BlockScore/followers","following_url":"https://api.github.com/users/BlockScore/following{/other_user}","gists_url":"https://api.github.com/users/BlockScore/gists{/gist_id}","starred_url":"https://api.github.com/users/BlockScore/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BlockScore/subscriptions","organizations_url":"https://api.github.com/users/BlockScore/orgs","repos_url":"https://api.github.com/users/BlockScore/repos","events_url":"https://api.github.com/users/BlockScore/events{/privacy}","received_events_url":"https://api.github.com/users/BlockScore/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/BlockScore/blockscore-ruby","description":":gem: An API wrapper for the BlockScore API using Ruby.","fork":false,"url":"https://api.github.com/repos/BlockScore/blockscore-ruby","forks_url":"https://api.github.com/repos/BlockScore/blockscore-ruby/forks","keys_url":"https://api.github.com/repos/BlockScore/blockscore-ruby/keys{/key_id}","collaborators_url":"https://api.github.com/repos/BlockScore/blockscore-ruby/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/BlockScore/blockscore-ruby/teams","hooks_url":"https://api.github.com/repos/BlockScore/blockscore-ruby/hooks","issue_events_url":"https://api.github.com/repos/BlockScore/blockscore-ruby/issues/events{/number}","events_url":"https://api.github.com/repos/BlockScore/blockscore-ruby/events","assignees_url":"https://api.github.com/repos/BlockScore/blockscore-ruby/assignees{/user}","branches_url":"https://api.github.com/repos/BlockScore/blockscore-ruby/branches{/branch}","tags_url":"https://api.github.com/repos/BlockScore/blockscore-ruby/tags","blobs_url":"https://api.github.com/repos/BlockScore/blockscore-ruby/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/BlockScore/blockscore-ruby/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/BlockScore/blockscore-ruby/git/refs{/sha}","trees_url":"https://api.github.com/repos/BlockScore/blockscore-ruby/git/trees{/sha}","statuses_url":"https://api.github.com/repos/BlockScore/blockscore-ruby/statuses/{sha}","languages_url":"https://api.github.com/repos/BlockScore/blockscore-ruby/languages","stargazers_url":"https://api.github.com/repos/BlockScore/blockscore-ruby/stargazers","contributors_url":"https://api.github.com/repos/BlockScore/blockscore-ruby/contributors","subscribers_url":"https://api.github.com/repos/BlockScore/blockscore-ruby/subscribers","subscription_url":"https://api.github.com/repos/BlockScore/blockscore-ruby/subscription","commits_url":"https://api.github.com/repos/BlockScore/blockscore-ruby/commits{/sha}","git_commits_url":"https://api.github.com/repos/BlockScore/blockscore-ruby/git/commits{/sha}","comments_url":"https://api.github.com/repos/BlockScore/blockscore-ruby/comments{/number}","issue_comment_url":"https://api.github.com/repos/BlockScore/blockscore-ruby/issues/comments{/number}","contents_url":"https://api.github.com/repos/BlockScore/blockscore-ruby/contents/{+path}","compare_url":"https://api.github.com/repos/BlockScore/blockscore-ruby/compare/{base}...{head}","merges_url":"https://api.github.com/repos/BlockScore/blockscore-ruby/merges","archive_url":"https://api.github.com/repos/BlockScore/blockscore-ruby/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/BlockScore/blockscore-ruby/downloads","issues_url":"https://api.github.com/repos/BlockScore/blockscore-ruby/issues{/number}","pulls_url":"https://api.github.com/repos/BlockScore/blockscore-ruby/pulls{/number}","milestones_url":"https://api.github.com/repos/BlockScore/blockscore-ruby/milestones{/number}","notifications_url":"https://api.github.com/repos/BlockScore/blockscore-ruby/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/BlockScore/blockscore-ruby/labels{/name}","releases_url":"https://api.github.com/repos/BlockScore/blockscore-ruby/releases{/id}","created_at":"2014-02-23T04:46:11Z","updated_at":"2015-08-06T23:27:29Z","pushed_at":"2015-09-11T00:00:17Z","git_url":"git://github.com/BlockScore/blockscore-ruby.git","ssh_url":"git@github.com:BlockScore/blockscore-ruby.git","clone_url":"https://github.com/BlockScore/blockscore-ruby.git","svn_url":"https://github.com/BlockScore/blockscore-ruby","homepage":"http://docs.blockscore.com/ruby/","size":1322,"stargazers_count":6,"watchers_count":6,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":5,"mirror_url":null,"open_issues_count":5,"forks":5,"open_issues":5,"watchers":6,"default_branch":"master"}},"base":{"label":"BlockScore:master","ref":"master","sha":"1e428e27fd879e1947a85990fb56788905bed540","user":{"login":"BlockScore","id":4524125,"avatar_url":"https://avatars.githubusercontent.com/u/4524125?v=3","gravatar_id":"","url":"https://api.github.com/users/BlockScore","html_url":"https://github.com/BlockScore","followers_url":"https://api.github.com/users/BlockScore/followers","following_url":"https://api.github.com/users/BlockScore/following{/other_user}","gists_url":"https://api.github.com/users/BlockScore/gists{/gist_id}","starred_url":"https://api.github.com/users/BlockScore/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BlockScore/subscriptions","organizations_url":"https://api.github.com/users/BlockScore/orgs","repos_url":"https://api.github.com/users/BlockScore/repos","events_url":"https://api.github.com/users/BlockScore/events{/privacy}","received_events_url":"https://api.github.com/users/BlockScore/received_events","type":"Organization","site_admin":false},"repo":{"id":17101801,"name":"blockscore-ruby","full_name":"BlockScore/blockscore-ruby","owner":{"login":"BlockScore","id":4524125,"avatar_url":"https://avatars.githubusercontent.com/u/4524125?v=3","gravatar_id":"","url":"https://api.github.com/users/BlockScore","html_url":"https://github.com/BlockScore","followers_url":"https://api.github.com/users/BlockScore/followers","following_url":"https://api.github.com/users/BlockScore/following{/other_user}","gists_url":"https://api.github.com/users/BlockScore/gists{/gist_id}","starred_url":"https://api.github.com/users/BlockScore/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BlockScore/subscriptions","organizations_url":"https://api.github.com/users/BlockScore/orgs","repos_url":"https://api.github.com/users/BlockScore/repos","events_url":"https://api.github.com/users/BlockScore/events{/privacy}","received_events_url":"https://api.github.com/users/BlockScore/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/BlockScore/blockscore-ruby","description":":gem: An API wrapper for the BlockScore API using Ruby.","fork":false,"url":"https://api.github.com/repos/BlockScore/blockscore-ruby","forks_url":"https://api.github.com/repos/BlockScore/blockscore-ruby/forks","keys_url":"https://api.github.com/repos/BlockScore/blockscore-ruby/keys{/key_id}","collaborators_url":"https://api.github.com/repos/BlockScore/blockscore-ruby/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/BlockScore/blockscore-ruby/teams","hooks_url":"https://api.github.com/repos/BlockScore/blockscore-ruby/hooks","issue_events_url":"https://api.github.com/repos/BlockScore/blockscore-ruby/issues/events{/number}","events_url":"https://api.github.com/repos/BlockScore/blockscore-ruby/events","assignees_url":"https://api.github.com/repos/BlockScore/blockscore-ruby/assignees{/user}","branches_url":"https://api.github.com/repos/BlockScore/blockscore-ruby/branches{/branch}","tags_url":"https://api.github.com/repos/BlockScore/blockscore-ruby/tags","blobs_url":"https://api.github.com/repos/BlockScore/blockscore-ruby/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/BlockScore/blockscore-ruby/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/BlockScore/blockscore-ruby/git/refs{/sha}","trees_url":"https://api.github.com/repos/BlockScore/blockscore-ruby/git/trees{/sha}","statuses_url":"https://api.github.com/repos/BlockScore/blockscore-ruby/statuses/{sha}","languages_url":"https://api.github.com/repos/BlockScore/blockscore-ruby/languages","stargazers_url":"https://api.github.com/repos/BlockScore/blockscore-ruby/stargazers","contributors_url":"https://api.github.com/repos/BlockScore/blockscore-ruby/contributors","subscribers_url":"https://api.github.com/repos/BlockScore/blockscore-ruby/subscribers","subscription_url":"https://api.github.com/repos/BlockScore/blockscore-ruby/subscription","commits_url":"https://api.github.com/repos/BlockScore/blockscore-ruby/commits{/sha}","git_commits_url":"https://api.github.com/repos/BlockScore/blockscore-ruby/git/commits{/sha}","comments_url":"https://api.github.com/repos/BlockScore/blockscore-ruby/comments{/number}","issue_comment_url":"https://api.github.com/repos/BlockScore/blockscore-ruby/issues/comments{/number}","contents_url":"https://api.github.com/repos/BlockScore/blockscore-ruby/contents/{+path}","compare_url":"https://api.github.com/repos/BlockScore/blockscore-ruby/compare/{base}...{head}","merges_url":"https://api.github.com/repos/BlockScore/blockscore-ruby/merges","archive_url":"https://api.github.com/repos/BlockScore/blockscore-ruby/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/BlockScore/blockscore-ruby/downloads","issues_url":"https://api.github.com/repos/BlockScore/blockscore-ruby/issues{/number}","pulls_url":"https://api.github.com/repos/BlockScore/blockscore-ruby/pulls{/number}","milestones_url":"https://api.github.com/repos/BlockScore/blockscore-ruby/milestones{/number}","notifications_url":"https://api.github.com/repos/BlockScore/blockscore-ruby/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/BlockScore/blockscore-ruby/labels{/name}","releases_url":"https://api.github.com/repos/BlockScore/blockscore-ruby/releases{/id}","created_at":"2014-02-23T04:46:11Z","updated_at":"2015-08-06T23:27:29Z","pushed_at":"2015-09-11T00:00:17Z","git_url":"git://github.com/BlockScore/blockscore-ruby.git","ssh_url":"git@github.com:BlockScore/blockscore-ruby.git","clone_url":"https://github.com/BlockScore/blockscore-ruby.git","svn_url":"https://github.com/BlockScore/blockscore-ruby","homepage":"http://docs.blockscore.com/ruby/","size":1322,"stargazers_count":6,"watchers_count":6,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":5,"mirror_url":null,"open_issues_count":5,"forks":5,"open_issues":5,"watchers":6,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/BlockScore/blockscore-ruby/pulls/23"},"html":{"href":"https://github.com/BlockScore/blockscore-ruby/pull/23"},"issue":{"href":"https://api.github.com/repos/BlockScore/blockscore-ruby/issues/23"},"comments":{"href":"https://api.github.com/repos/BlockScore/blockscore-ruby/issues/23/comments"},"review_comments":{"href":"https://api.github.com/repos/BlockScore/blockscore-ruby/pulls/23/comments"},"review_comment":{"href":"https://api.github.com/repos/BlockScore/blockscore-ruby/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/BlockScore/blockscore-ruby/pulls/23/commits"},"statuses":{"href":"https://api.github.com/repos/BlockScore/blockscore-ruby/statuses/999a725638dbac8b796e6ce984c78ae0ca119e1c"}}}}