{"action":"created","comment":{"url":"https://api.github.com/repos/CandN/CandN.github.io/pulls/comments/58793923","id":58793923,"diff_hunk":"@@ -0,0 +1,65 @@\n+---\n+layout: post\n+title: Service Objects\n+category: Ruby\n+author: dmp0x7c5\n+---\n+\n+Imagine you have really complex legacy code to work with and you run git blame just to append more and more names to your personal blacklist... Service objects will certainly help you. If you haven't heard about them before, here comes the shortest possible definition: Service object is just a plain old ruby object (PORO) responsible for ONE thing. Some people call them just object. That's it. It doesn't matter how you implement it or where you place it, the ONE thing is the key.\n+\n+\n+## Code\n+\n+I like this scheme:\n+\n+{% highlight ruby %}\n+module CandidateServices\n+  class ExperienceUpdater\n+    def initialize(candidate:)\n+      @candidate = candidate\n+    end\n+\n+    def call\n+      release_the_kraken\n+    end\n+    \n+    private\n+    \n+    attr_reader :candidate\n+  end\n+end","path":"_posts/2016-04-06-service_objects.md","position":30,"original_position":30,"commit_id":"d88f4eb07152277fea2ead3da4af2453dc6e8607","original_commit_id":"d88f4eb07152277fea2ead3da4af2453dc6e8607","user":{"login":"dmp0x7c5","id":1557995,"avatar_url":"https://avatars.githubusercontent.com/u/1557995?v=3","gravatar_id":"","url":"https://api.github.com/users/dmp0x7c5","html_url":"https://github.com/dmp0x7c5","followers_url":"https://api.github.com/users/dmp0x7c5/followers","following_url":"https://api.github.com/users/dmp0x7c5/following{/other_user}","gists_url":"https://api.github.com/users/dmp0x7c5/gists{/gist_id}","starred_url":"https://api.github.com/users/dmp0x7c5/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dmp0x7c5/subscriptions","organizations_url":"https://api.github.com/users/dmp0x7c5/orgs","repos_url":"https://api.github.com/users/dmp0x7c5/repos","events_url":"https://api.github.com/users/dmp0x7c5/events{/privacy}","received_events_url":"https://api.github.com/users/dmp0x7c5/received_events","type":"User","site_admin":false},"body":"and lambda example with Luke :)","created_at":"2016-04-06T22:34:58Z","updated_at":"2016-04-06T22:34:58Z","html_url":"https://github.com/CandN/CandN.github.io/pull/22#discussion_r58793923","pull_request_url":"https://api.github.com/repos/CandN/CandN.github.io/pulls/22","_links":{"self":{"href":"https://api.github.com/repos/CandN/CandN.github.io/pulls/comments/58793923"},"html":{"href":"https://github.com/CandN/CandN.github.io/pull/22#discussion_r58793923"},"pull_request":{"href":"https://api.github.com/repos/CandN/CandN.github.io/pulls/22"}}},"pull_request":{"url":"https://api.github.com/repos/CandN/CandN.github.io/pulls/22","id":65387165,"html_url":"https://github.com/CandN/CandN.github.io/pull/22","diff_url":"https://github.com/CandN/CandN.github.io/pull/22.diff","patch_url":"https://github.com/CandN/CandN.github.io/pull/22.patch","issue_url":"https://api.github.com/repos/CandN/CandN.github.io/issues/22","number":22,"state":"open","locked":false,"title":"Service objects article","user":{"login":"dmp0x7c5","id":1557995,"avatar_url":"https://avatars.githubusercontent.com/u/1557995?v=3","gravatar_id":"","url":"https://api.github.com/users/dmp0x7c5","html_url":"https://github.com/dmp0x7c5","followers_url":"https://api.github.com/users/dmp0x7c5/followers","following_url":"https://api.github.com/users/dmp0x7c5/following{/other_user}","gists_url":"https://api.github.com/users/dmp0x7c5/gists{/gist_id}","starred_url":"https://api.github.com/users/dmp0x7c5/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dmp0x7c5/subscriptions","organizations_url":"https://api.github.com/users/dmp0x7c5/orgs","repos_url":"https://api.github.com/users/dmp0x7c5/repos","events_url":"https://api.github.com/users/dmp0x7c5/events{/privacy}","received_events_url":"https://api.github.com/users/dmp0x7c5/received_events","type":"User","site_admin":false},"body":"\r\n\r\n","created_at":"2016-04-05T23:14:39Z","updated_at":"2016-04-06T22:34:58Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6722b8fddb28a41b125f0273a5c4599275a04806","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/CandN/CandN.github.io/pulls/22/commits","review_comments_url":"https://api.github.com/repos/CandN/CandN.github.io/pulls/22/comments","review_comment_url":"https://api.github.com/repos/CandN/CandN.github.io/pulls/comments{/number}","comments_url":"https://api.github.com/repos/CandN/CandN.github.io/issues/22/comments","statuses_url":"https://api.github.com/repos/CandN/CandN.github.io/statuses/d88f4eb07152277fea2ead3da4af2453dc6e8607","head":{"label":"CandN:article-service-objects","ref":"article-service-objects","sha":"d88f4eb07152277fea2ead3da4af2453dc6e8607","user":{"login":"CandN","id":18050468,"avatar_url":"https://avatars.githubusercontent.com/u/18050468?v=3","gravatar_id":"","url":"https://api.github.com/users/CandN","html_url":"https://github.com/CandN","followers_url":"https://api.github.com/users/CandN/followers","following_url":"https://api.github.com/users/CandN/following{/other_user}","gists_url":"https://api.github.com/users/CandN/gists{/gist_id}","starred_url":"https://api.github.com/users/CandN/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CandN/subscriptions","organizations_url":"https://api.github.com/users/CandN/orgs","repos_url":"https://api.github.com/users/CandN/repos","events_url":"https://api.github.com/users/CandN/events{/privacy}","received_events_url":"https://api.github.com/users/CandN/received_events","type":"Organization","site_admin":false},"repo":{"id":54653009,"name":"CandN.github.io","full_name":"CandN/CandN.github.io","owner":{"login":"CandN","id":18050468,"avatar_url":"https://avatars.githubusercontent.com/u/18050468?v=3","gravatar_id":"","url":"https://api.github.com/users/CandN","html_url":"https://github.com/CandN","followers_url":"https://api.github.com/users/CandN/followers","following_url":"https://api.github.com/users/CandN/following{/other_user}","gists_url":"https://api.github.com/users/CandN/gists{/gist_id}","starred_url":"https://api.github.com/users/CandN/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CandN/subscriptions","organizations_url":"https://api.github.com/users/CandN/orgs","repos_url":"https://api.github.com/users/CandN/repos","events_url":"https://api.github.com/users/CandN/events{/privacy}","received_events_url":"https://api.github.com/users/CandN/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/CandN/CandN.github.io","description":"","fork":false,"url":"https://api.github.com/repos/CandN/CandN.github.io","forks_url":"https://api.github.com/repos/CandN/CandN.github.io/forks","keys_url":"https://api.github.com/repos/CandN/CandN.github.io/keys{/key_id}","collaborators_url":"https://api.github.com/repos/CandN/CandN.github.io/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/CandN/CandN.github.io/teams","hooks_url":"https://api.github.com/repos/CandN/CandN.github.io/hooks","issue_events_url":"https://api.github.com/repos/CandN/CandN.github.io/issues/events{/number}","events_url":"https://api.github.com/repos/CandN/CandN.github.io/events","assignees_url":"https://api.github.com/repos/CandN/CandN.github.io/assignees{/user}","branches_url":"https://api.github.com/repos/CandN/CandN.github.io/branches{/branch}","tags_url":"https://api.github.com/repos/CandN/CandN.github.io/tags","blobs_url":"https://api.github.com/repos/CandN/CandN.github.io/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/CandN/CandN.github.io/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/CandN/CandN.github.io/git/refs{/sha}","trees_url":"https://api.github.com/repos/CandN/CandN.github.io/git/trees{/sha}","statuses_url":"https://api.github.com/repos/CandN/CandN.github.io/statuses/{sha}","languages_url":"https://api.github.com/repos/CandN/CandN.github.io/languages","stargazers_url":"https://api.github.com/repos/CandN/CandN.github.io/stargazers","contributors_url":"https://api.github.com/repos/CandN/CandN.github.io/contributors","subscribers_url":"https://api.github.com/repos/CandN/CandN.github.io/subscribers","subscription_url":"https://api.github.com/repos/CandN/CandN.github.io/subscription","commits_url":"https://api.github.com/repos/CandN/CandN.github.io/commits{/sha}","git_commits_url":"https://api.github.com/repos/CandN/CandN.github.io/git/commits{/sha}","comments_url":"https://api.github.com/repos/CandN/CandN.github.io/comments{/number}","issue_comment_url":"https://api.github.com/repos/CandN/CandN.github.io/issues/comments{/number}","contents_url":"https://api.github.com/repos/CandN/CandN.github.io/contents/{+path}","compare_url":"https://api.github.com/repos/CandN/CandN.github.io/compare/{base}...{head}","merges_url":"https://api.github.com/repos/CandN/CandN.github.io/merges","archive_url":"https://api.github.com/repos/CandN/CandN.github.io/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/CandN/CandN.github.io/downloads","issues_url":"https://api.github.com/repos/CandN/CandN.github.io/issues{/number}","pulls_url":"https://api.github.com/repos/CandN/CandN.github.io/pulls{/number}","milestones_url":"https://api.github.com/repos/CandN/CandN.github.io/milestones{/number}","notifications_url":"https://api.github.com/repos/CandN/CandN.github.io/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/CandN/CandN.github.io/labels{/name}","releases_url":"https://api.github.com/repos/CandN/CandN.github.io/releases{/id}","deployments_url":"https://api.github.com/repos/CandN/CandN.github.io/deployments","created_at":"2016-03-24T15:31:02Z","updated_at":"2016-04-02T11:57:47Z","pushed_at":"2016-04-05T23:53:47Z","git_url":"git://github.com/CandN/CandN.github.io.git","ssh_url":"git@github.com:CandN/CandN.github.io.git","clone_url":"https://github.com/CandN/CandN.github.io.git","svn_url":"https://github.com/CandN/CandN.github.io","homepage":null,"size":961,"stargazers_count":1,"watchers_count":1,"language":"HTML","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":3,"forks":0,"open_issues":3,"watchers":1,"default_branch":"master"}},"base":{"label":"CandN:master","ref":"master","sha":"d11cc37d23794937a3d62ad2d2f0894685a5b887","user":{"login":"CandN","id":18050468,"avatar_url":"https://avatars.githubusercontent.com/u/18050468?v=3","gravatar_id":"","url":"https://api.github.com/users/CandN","html_url":"https://github.com/CandN","followers_url":"https://api.github.com/users/CandN/followers","following_url":"https://api.github.com/users/CandN/following{/other_user}","gists_url":"https://api.github.com/users/CandN/gists{/gist_id}","starred_url":"https://api.github.com/users/CandN/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CandN/subscriptions","organizations_url":"https://api.github.com/users/CandN/orgs","repos_url":"https://api.github.com/users/CandN/repos","events_url":"https://api.github.com/users/CandN/events{/privacy}","received_events_url":"https://api.github.com/users/CandN/received_events","type":"Organization","site_admin":false},"repo":{"id":54653009,"name":"CandN.github.io","full_name":"CandN/CandN.github.io","owner":{"login":"CandN","id":18050468,"avatar_url":"https://avatars.githubusercontent.com/u/18050468?v=3","gravatar_id":"","url":"https://api.github.com/users/CandN","html_url":"https://github.com/CandN","followers_url":"https://api.github.com/users/CandN/followers","following_url":"https://api.github.com/users/CandN/following{/other_user}","gists_url":"https://api.github.com/users/CandN/gists{/gist_id}","starred_url":"https://api.github.com/users/CandN/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CandN/subscriptions","organizations_url":"https://api.github.com/users/CandN/orgs","repos_url":"https://api.github.com/users/CandN/repos","events_url":"https://api.github.com/users/CandN/events{/privacy}","received_events_url":"https://api.github.com/users/CandN/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/CandN/CandN.github.io","description":"","fork":false,"url":"https://api.github.com/repos/CandN/CandN.github.io","forks_url":"https://api.github.com/repos/CandN/CandN.github.io/forks","keys_url":"https://api.github.com/repos/CandN/CandN.github.io/keys{/key_id}","collaborators_url":"https://api.github.com/repos/CandN/CandN.github.io/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/CandN/CandN.github.io/teams","hooks_url":"https://api.github.com/repos/CandN/CandN.github.io/hooks","issue_events_url":"https://api.github.com/repos/CandN/CandN.github.io/issues/events{/number}","events_url":"https://api.github.com/repos/CandN/CandN.github.io/events","assignees_url":"https://api.github.com/repos/CandN/CandN.github.io/assignees{/user}","branches_url":"https://api.github.com/repos/CandN/CandN.github.io/branches{/branch}","tags_url":"https://api.github.com/repos/CandN/CandN.github.io/tags","blobs_url":"https://api.github.com/repos/CandN/CandN.github.io/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/CandN/CandN.github.io/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/CandN/CandN.github.io/git/refs{/sha}","trees_url":"https://api.github.com/repos/CandN/CandN.github.io/git/trees{/sha}","statuses_url":"https://api.github.com/repos/CandN/CandN.github.io/statuses/{sha}","languages_url":"https://api.github.com/repos/CandN/CandN.github.io/languages","stargazers_url":"https://api.github.com/repos/CandN/CandN.github.io/stargazers","contributors_url":"https://api.github.com/repos/CandN/CandN.github.io/contributors","subscribers_url":"https://api.github.com/repos/CandN/CandN.github.io/subscribers","subscription_url":"https://api.github.com/repos/CandN/CandN.github.io/subscription","commits_url":"https://api.github.com/repos/CandN/CandN.github.io/commits{/sha}","git_commits_url":"https://api.github.com/repos/CandN/CandN.github.io/git/commits{/sha}","comments_url":"https://api.github.com/repos/CandN/CandN.github.io/comments{/number}","issue_comment_url":"https://api.github.com/repos/CandN/CandN.github.io/issues/comments{/number}","contents_url":"https://api.github.com/repos/CandN/CandN.github.io/contents/{+path}","compare_url":"https://api.github.com/repos/CandN/CandN.github.io/compare/{base}...{head}","merges_url":"https://api.github.com/repos/CandN/CandN.github.io/merges","archive_url":"https://api.github.com/repos/CandN/CandN.github.io/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/CandN/CandN.github.io/downloads","issues_url":"https://api.github.com/repos/CandN/CandN.github.io/issues{/number}","pulls_url":"https://api.github.com/repos/CandN/CandN.github.io/pulls{/number}","milestones_url":"https://api.github.com/repos/CandN/CandN.github.io/milestones{/number}","notifications_url":"https://api.github.com/repos/CandN/CandN.github.io/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/CandN/CandN.github.io/labels{/name}","releases_url":"https://api.github.com/repos/CandN/CandN.github.io/releases{/id}","deployments_url":"https://api.github.com/repos/CandN/CandN.github.io/deployments","created_at":"2016-03-24T15:31:02Z","updated_at":"2016-04-02T11:57:47Z","pushed_at":"2016-04-05T23:53:47Z","git_url":"git://github.com/CandN/CandN.github.io.git","ssh_url":"git@github.com:CandN/CandN.github.io.git","clone_url":"https://github.com/CandN/CandN.github.io.git","svn_url":"https://github.com/CandN/CandN.github.io","homepage":null,"size":961,"stargazers_count":1,"watchers_count":1,"language":"HTML","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":3,"forks":0,"open_issues":3,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/CandN/CandN.github.io/pulls/22"},"html":{"href":"https://github.com/CandN/CandN.github.io/pull/22"},"issue":{"href":"https://api.github.com/repos/CandN/CandN.github.io/issues/22"},"comments":{"href":"https://api.github.com/repos/CandN/CandN.github.io/issues/22/comments"},"review_comments":{"href":"https://api.github.com/repos/CandN/CandN.github.io/pulls/22/comments"},"review_comment":{"href":"https://api.github.com/repos/CandN/CandN.github.io/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/CandN/CandN.github.io/pulls/22/commits"},"statuses":{"href":"https://api.github.com/repos/CandN/CandN.github.io/statuses/d88f4eb07152277fea2ead3da4af2453dc6e8607"}}}}