{"action":"created","comment":{"url":"https://api.github.com/repos/IshidaHIRO/SDD3/pulls/comments/85121891","pull_request_review_id":5854836,"id":85121891,"diff_hunk":"@@ -1,2 +1,83 @@\n module WelcomeHelper\n+  def most?(target,val1,val2)\n+     if(target.nil? || !self.num?(target))\n+       return false\n+     end\n+     if(!val1.nil? && self.num?(val1) && target < val1)\n+       return false\n+     end\n+     if(!val2.nil? && self.num?(val2) && target < val2)\n+       return false\n+     end\n+     return true\n+  end\n+\n+  def num?(val)\n+    val.is_a?(Integer)||val.is_a?(Float)\n+  end\n+\n+  def least?(target,val1,val2)\n+     if(target.nil? || !self.num?(target))\n+       return false\n+     end\n+     if(!val1.nil? && self.num?(val1) && target > val1)\n+       return false\n+     end\n+     if(!val2.nil? && self.num?(val2) && target > val2)\n+       return false\n+     end\n+     return true\n+  end\n+  \n+  def emphasize_most(target,val1,val2)\n+     if(self.most?(target,val1,val2))\n+        content_tag(:span,target,:class=>'first')\n+     else\n+        \"#{target}\"\n+     end\n+  end\n+\n+  def emphasize_least(target,val1,val2)\n+     if(self.least?(target,val1,val2))\n+        content_tag(:span,target,:class=>'first')\n+     else\n+        \"#{target}\"\n+     end\n+  end\n+  \n+  def print_product(target,val1,val2)\n+     content_tag(:div, :class => 'product') do\n+       concat content_tag(:p, target.name,:class => 'p_name') \n+       concat (content_tag(:dl ,:class => 'dl-horizontal') do\n+          concat content_tag(:dt,\"税込価格\")\n+          concat content_tag(:dd,self.emphasize_least(target.price,val1.price,val2.price) + \"円\")\n+          concat content_tag(:dt,\"熱量\")\n+          concat content_tag(:dd,emphasize_least(target.calorie,val1.calorie,val2.calorie)+\"kcal\")\n+          concat content_tag(:dt,\"分量\")\n+          concat content_tag(:dd,emphasize_most(target.net,val1.net,val2.net)+\"g\")\n+          concat content_tag(:dt,\"タンパク質\")\n+          concat content_tag(:dd,emphasize_most(target.protein,val1.protein,val2.protein)+\"g\")\n+          concat content_tag(:dt,\"脂質\")\n+          concat content_tag(:dd,emphasize_least(target.fat,val1.fat,val2.fat)+\"g\")\n+          concat content_tag(:dt,\"炭水化物\")\n+          concat content_tag(:dd,emphasize_least(target.carbon,val1.carbon,val2.carbon)+\"g\")\n+          concat content_tag(:dt,\"糖質\")\n+          concat content_tag(:dd,emphasize_least(target.sugar,val1.sugar,val2.sugar)+\"g\")\n+          concat content_tag(:dt,\"食物繊維\")\n+          concat content_tag(:dd,emphasize_most(target.fiber,val1.fiber,val2.fiber)+\"g\")\n+          concat content_tag(:dt,\"ナトリウム\")","path":"app/helpers/welcome_helper.rb","position":68,"original_position":68,"commit_id":"6dceb4cafc5c554599829b121b836faf9c794428","original_commit_id":"6dceb4cafc5c554599829b121b836faf9c794428","user":{"login":"tantan5","id":3953851,"avatar_url":"https://avatars.githubusercontent.com/u/3953851?v=3","gravatar_id":"","url":"https://api.github.com/users/tantan5","html_url":"https://github.com/tantan5","followers_url":"https://api.github.com/users/tantan5/followers","following_url":"https://api.github.com/users/tantan5/following{/other_user}","gists_url":"https://api.github.com/users/tantan5/gists{/gist_id}","starred_url":"https://api.github.com/users/tantan5/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tantan5/subscriptions","organizations_url":"https://api.github.com/users/tantan5/orgs","repos_url":"https://api.github.com/users/tantan5/repos","events_url":"https://api.github.com/users/tantan5/events{/privacy}","received_events_url":"https://api.github.com/users/tantan5/received_events","type":"User","site_admin":false},"body":"ナトリウムは小さい方が好ましい（POレビューでのFB）","created_at":"2016-10-26T13:31:11Z","updated_at":"2016-10-26T13:31:29Z","html_url":"https://github.com/IshidaHIRO/SDD3/pull/61#discussion_r85121891","pull_request_url":"https://api.github.com/repos/IshidaHIRO/SDD3/pulls/61","_links":{"self":{"href":"https://api.github.com/repos/IshidaHIRO/SDD3/pulls/comments/85121891"},"html":{"href":"https://github.com/IshidaHIRO/SDD3/pull/61#discussion_r85121891"},"pull_request":{"href":"https://api.github.com/repos/IshidaHIRO/SDD3/pulls/61"}}},"pull_request":{"url":"https://api.github.com/repos/IshidaHIRO/SDD3/pulls/61","id":90516885,"html_url":"https://github.com/IshidaHIRO/SDD3/pull/61","diff_url":"https://github.com/IshidaHIRO/SDD3/pull/61.diff","patch_url":"https://github.com/IshidaHIRO/SDD3/pull/61.patch","issue_url":"https://api.github.com/repos/IshidaHIRO/SDD3/issues/61","number":61,"state":"open","locked":false,"title":"1位の項目を強調する","user":{"login":"tantan5","id":3953851,"avatar_url":"https://avatars.githubusercontent.com/u/3953851?v=3","gravatar_id":"","url":"https://api.github.com/users/tantan5","html_url":"https://github.com/tantan5","followers_url":"https://api.github.com/users/tantan5/followers","following_url":"https://api.github.com/users/tantan5/following{/other_user}","gists_url":"https://api.github.com/users/tantan5/gists{/gist_id}","starred_url":"https://api.github.com/users/tantan5/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tantan5/subscriptions","organizations_url":"https://api.github.com/users/tantan5/orgs","repos_url":"https://api.github.com/users/tantan5/repos","events_url":"https://api.github.com/users/tantan5/events{/privacy}","received_events_url":"https://api.github.com/users/tantan5/received_events","type":"User","site_admin":false},"body":"#57 \r\nViewをHelperに切り出していたりざっくりですが単体テスト追加したり、影響範囲が大きいため要確認願います。\r\nhttps://obscure-chamber-54504.herokuapp.com/\r\n\r\n一番大きいものを赤字にしている項目\r\n・タンパク質\r\n・食物繊維\r\n・ナトリウム\r\n・話題数\r\n・おいしい\r\n一番小さいものを赤字にしている項目\r\n・価格\r\n・分量\r\n・熱量\r\n・脂質\r\n・炭水化物\r\n・糖質\r\n・まずい\r\n","created_at":"2016-10-23T14:18:50Z","updated_at":"2016-10-26T13:31:29Z","closed_at":null,"merged_at":null,"merge_commit_sha":"97545d93abdc65e6222f9c2685bdec8076b1a309","assignee":{"login":"tantan5","id":3953851,"avatar_url":"https://avatars.githubusercontent.com/u/3953851?v=3","gravatar_id":"","url":"https://api.github.com/users/tantan5","html_url":"https://github.com/tantan5","followers_url":"https://api.github.com/users/tantan5/followers","following_url":"https://api.github.com/users/tantan5/following{/other_user}","gists_url":"https://api.github.com/users/tantan5/gists{/gist_id}","starred_url":"https://api.github.com/users/tantan5/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tantan5/subscriptions","organizations_url":"https://api.github.com/users/tantan5/orgs","repos_url":"https://api.github.com/users/tantan5/repos","events_url":"https://api.github.com/users/tantan5/events{/privacy}","received_events_url":"https://api.github.com/users/tantan5/received_events","type":"User","site_admin":false},"assignees":[{"login":"tantan5","id":3953851,"avatar_url":"https://avatars.githubusercontent.com/u/3953851?v=3","gravatar_id":"","url":"https://api.github.com/users/tantan5","html_url":"https://github.com/tantan5","followers_url":"https://api.github.com/users/tantan5/followers","following_url":"https://api.github.com/users/tantan5/following{/other_user}","gists_url":"https://api.github.com/users/tantan5/gists{/gist_id}","starred_url":"https://api.github.com/users/tantan5/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tantan5/subscriptions","organizations_url":"https://api.github.com/users/tantan5/orgs","repos_url":"https://api.github.com/users/tantan5/repos","events_url":"https://api.github.com/users/tantan5/events{/privacy}","received_events_url":"https://api.github.com/users/tantan5/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/IshidaHIRO/SDD3/milestones/1","html_url":"https://github.com/IshidaHIRO/SDD3/milestones/sprint4","labels_url":"https://api.github.com/repos/IshidaHIRO/SDD3/milestones/1/labels","id":2086960,"number":1,"title":"sprint4","description":null,"creator":{"login":"tantan5","id":3953851,"avatar_url":"https://avatars.githubusercontent.com/u/3953851?v=3","gravatar_id":"","url":"https://api.github.com/users/tantan5","html_url":"https://github.com/tantan5","followers_url":"https://api.github.com/users/tantan5/followers","following_url":"https://api.github.com/users/tantan5/following{/other_user}","gists_url":"https://api.github.com/users/tantan5/gists{/gist_id}","starred_url":"https://api.github.com/users/tantan5/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tantan5/subscriptions","organizations_url":"https://api.github.com/users/tantan5/orgs","repos_url":"https://api.github.com/users/tantan5/repos","events_url":"https://api.github.com/users/tantan5/events{/privacy}","received_events_url":"https://api.github.com/users/tantan5/received_events","type":"User","site_admin":false},"open_issues":4,"closed_issues":0,"state":"open","created_at":"2016-10-23T03:39:39Z","updated_at":"2016-10-23T16:09:54Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/IshidaHIRO/SDD3/pulls/61/commits","review_comments_url":"https://api.github.com/repos/IshidaHIRO/SDD3/pulls/61/comments","review_comment_url":"https://api.github.com/repos/IshidaHIRO/SDD3/pulls/comments{/number}","comments_url":"https://api.github.com/repos/IshidaHIRO/SDD3/issues/61/comments","statuses_url":"https://api.github.com/repos/IshidaHIRO/SDD3/statuses/6dceb4cafc5c554599829b121b836faf9c794428","head":{"label":"IshidaHIRO:emphasizeFirstPlace","ref":"emphasizeFirstPlace","sha":"6dceb4cafc5c554599829b121b836faf9c794428","user":{"login":"IshidaHIRO","id":19665216,"avatar_url":"https://avatars.githubusercontent.com/u/19665216?v=3","gravatar_id":"","url":"https://api.github.com/users/IshidaHIRO","html_url":"https://github.com/IshidaHIRO","followers_url":"https://api.github.com/users/IshidaHIRO/followers","following_url":"https://api.github.com/users/IshidaHIRO/following{/other_user}","gists_url":"https://api.github.com/users/IshidaHIRO/gists{/gist_id}","starred_url":"https://api.github.com/users/IshidaHIRO/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IshidaHIRO/subscriptions","organizations_url":"https://api.github.com/users/IshidaHIRO/orgs","repos_url":"https://api.github.com/users/IshidaHIRO/repos","events_url":"https://api.github.com/users/IshidaHIRO/events{/privacy}","received_events_url":"https://api.github.com/users/IshidaHIRO/received_events","type":"User","site_admin":false},"repo":{"id":69555776,"name":"SDD3","full_name":"IshidaHIRO/SDD3","owner":{"login":"IshidaHIRO","id":19665216,"avatar_url":"https://avatars.githubusercontent.com/u/19665216?v=3","gravatar_id":"","url":"https://api.github.com/users/IshidaHIRO","html_url":"https://github.com/IshidaHIRO","followers_url":"https://api.github.com/users/IshidaHIRO/followers","following_url":"https://api.github.com/users/IshidaHIRO/following{/other_user}","gists_url":"https://api.github.com/users/IshidaHIRO/gists{/gist_id}","starred_url":"https://api.github.com/users/IshidaHIRO/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IshidaHIRO/subscriptions","organizations_url":"https://api.github.com/users/IshidaHIRO/orgs","repos_url":"https://api.github.com/users/IshidaHIRO/repos","events_url":"https://api.github.com/users/IshidaHIRO/events{/privacy}","received_events_url":"https://api.github.com/users/IshidaHIRO/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/IshidaHIRO/SDD3","description":"enpit2016","fork":false,"url":"https://api.github.com/repos/IshidaHIRO/SDD3","forks_url":"https://api.github.com/repos/IshidaHIRO/SDD3/forks","keys_url":"https://api.github.com/repos/IshidaHIRO/SDD3/keys{/key_id}","collaborators_url":"https://api.github.com/repos/IshidaHIRO/SDD3/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/IshidaHIRO/SDD3/teams","hooks_url":"https://api.github.com/repos/IshidaHIRO/SDD3/hooks","issue_events_url":"https://api.github.com/repos/IshidaHIRO/SDD3/issues/events{/number}","events_url":"https://api.github.com/repos/IshidaHIRO/SDD3/events","assignees_url":"https://api.github.com/repos/IshidaHIRO/SDD3/assignees{/user}","branches_url":"https://api.github.com/repos/IshidaHIRO/SDD3/branches{/branch}","tags_url":"https://api.github.com/repos/IshidaHIRO/SDD3/tags","blobs_url":"https://api.github.com/repos/IshidaHIRO/SDD3/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/IshidaHIRO/SDD3/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/IshidaHIRO/SDD3/git/refs{/sha}","trees_url":"https://api.github.com/repos/IshidaHIRO/SDD3/git/trees{/sha}","statuses_url":"https://api.github.com/repos/IshidaHIRO/SDD3/statuses/{sha}","languages_url":"https://api.github.com/repos/IshidaHIRO/SDD3/languages","stargazers_url":"https://api.github.com/repos/IshidaHIRO/SDD3/stargazers","contributors_url":"https://api.github.com/repos/IshidaHIRO/SDD3/contributors","subscribers_url":"https://api.github.com/repos/IshidaHIRO/SDD3/subscribers","subscription_url":"https://api.github.com/repos/IshidaHIRO/SDD3/subscription","commits_url":"https://api.github.com/repos/IshidaHIRO/SDD3/commits{/sha}","git_commits_url":"https://api.github.com/repos/IshidaHIRO/SDD3/git/commits{/sha}","comments_url":"https://api.github.com/repos/IshidaHIRO/SDD3/comments{/number}","issue_comment_url":"https://api.github.com/repos/IshidaHIRO/SDD3/issues/comments{/number}","contents_url":"https://api.github.com/repos/IshidaHIRO/SDD3/contents/{+path}","compare_url":"https://api.github.com/repos/IshidaHIRO/SDD3/compare/{base}...{head}","merges_url":"https://api.github.com/repos/IshidaHIRO/SDD3/merges","archive_url":"https://api.github.com/repos/IshidaHIRO/SDD3/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/IshidaHIRO/SDD3/downloads","issues_url":"https://api.github.com/repos/IshidaHIRO/SDD3/issues{/number}","pulls_url":"https://api.github.com/repos/IshidaHIRO/SDD3/pulls{/number}","milestones_url":"https://api.github.com/repos/IshidaHIRO/SDD3/milestones{/number}","notifications_url":"https://api.github.com/repos/IshidaHIRO/SDD3/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/IshidaHIRO/SDD3/labels{/name}","releases_url":"https://api.github.com/repos/IshidaHIRO/SDD3/releases{/id}","deployments_url":"https://api.github.com/repos/IshidaHIRO/SDD3/deployments","created_at":"2016-09-29T10:08:01Z","updated_at":"2016-10-15T04:52:52Z","pushed_at":"2016-10-23T15:58:47Z","git_url":"git://github.com/IshidaHIRO/SDD3.git","ssh_url":"git@github.com:IshidaHIRO/SDD3.git","clone_url":"https://github.com/IshidaHIRO/SDD3.git","svn_url":"https://github.com/IshidaHIRO/SDD3","homepage":null,"size":2561,"stargazers_count":3,"watchers_count":3,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":15,"forks":0,"open_issues":15,"watchers":3,"default_branch":"master"}},"base":{"label":"IshidaHIRO:master","ref":"master","sha":"8d6f4c8f8f9ff4cee05f7f15b36e26fffdc10c24","user":{"login":"IshidaHIRO","id":19665216,"avatar_url":"https://avatars.githubusercontent.com/u/19665216?v=3","gravatar_id":"","url":"https://api.github.com/users/IshidaHIRO","html_url":"https://github.com/IshidaHIRO","followers_url":"https://api.github.com/users/IshidaHIRO/followers","following_url":"https://api.github.com/users/IshidaHIRO/following{/other_user}","gists_url":"https://api.github.com/users/IshidaHIRO/gists{/gist_id}","starred_url":"https://api.github.com/users/IshidaHIRO/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IshidaHIRO/subscriptions","organizations_url":"https://api.github.com/users/IshidaHIRO/orgs","repos_url":"https://api.github.com/users/IshidaHIRO/repos","events_url":"https://api.github.com/users/IshidaHIRO/events{/privacy}","received_events_url":"https://api.github.com/users/IshidaHIRO/received_events","type":"User","site_admin":false},"repo":{"id":69555776,"name":"SDD3","full_name":"IshidaHIRO/SDD3","owner":{"login":"IshidaHIRO","id":19665216,"avatar_url":"https://avatars.githubusercontent.com/u/19665216?v=3","gravatar_id":"","url":"https://api.github.com/users/IshidaHIRO","html_url":"https://github.com/IshidaHIRO","followers_url":"https://api.github.com/users/IshidaHIRO/followers","following_url":"https://api.github.com/users/IshidaHIRO/following{/other_user}","gists_url":"https://api.github.com/users/IshidaHIRO/gists{/gist_id}","starred_url":"https://api.github.com/users/IshidaHIRO/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IshidaHIRO/subscriptions","organizations_url":"https://api.github.com/users/IshidaHIRO/orgs","repos_url":"https://api.github.com/users/IshidaHIRO/repos","events_url":"https://api.github.com/users/IshidaHIRO/events{/privacy}","received_events_url":"https://api.github.com/users/IshidaHIRO/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/IshidaHIRO/SDD3","description":"enpit2016","fork":false,"url":"https://api.github.com/repos/IshidaHIRO/SDD3","forks_url":"https://api.github.com/repos/IshidaHIRO/SDD3/forks","keys_url":"https://api.github.com/repos/IshidaHIRO/SDD3/keys{/key_id}","collaborators_url":"https://api.github.com/repos/IshidaHIRO/SDD3/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/IshidaHIRO/SDD3/teams","hooks_url":"https://api.github.com/repos/IshidaHIRO/SDD3/hooks","issue_events_url":"https://api.github.com/repos/IshidaHIRO/SDD3/issues/events{/number}","events_url":"https://api.github.com/repos/IshidaHIRO/SDD3/events","assignees_url":"https://api.github.com/repos/IshidaHIRO/SDD3/assignees{/user}","branches_url":"https://api.github.com/repos/IshidaHIRO/SDD3/branches{/branch}","tags_url":"https://api.github.com/repos/IshidaHIRO/SDD3/tags","blobs_url":"https://api.github.com/repos/IshidaHIRO/SDD3/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/IshidaHIRO/SDD3/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/IshidaHIRO/SDD3/git/refs{/sha}","trees_url":"https://api.github.com/repos/IshidaHIRO/SDD3/git/trees{/sha}","statuses_url":"https://api.github.com/repos/IshidaHIRO/SDD3/statuses/{sha}","languages_url":"https://api.github.com/repos/IshidaHIRO/SDD3/languages","stargazers_url":"https://api.github.com/repos/IshidaHIRO/SDD3/stargazers","contributors_url":"https://api.github.com/repos/IshidaHIRO/SDD3/contributors","subscribers_url":"https://api.github.com/repos/IshidaHIRO/SDD3/subscribers","subscription_url":"https://api.github.com/repos/IshidaHIRO/SDD3/subscription","commits_url":"https://api.github.com/repos/IshidaHIRO/SDD3/commits{/sha}","git_commits_url":"https://api.github.com/repos/IshidaHIRO/SDD3/git/commits{/sha}","comments_url":"https://api.github.com/repos/IshidaHIRO/SDD3/comments{/number}","issue_comment_url":"https://api.github.com/repos/IshidaHIRO/SDD3/issues/comments{/number}","contents_url":"https://api.github.com/repos/IshidaHIRO/SDD3/contents/{+path}","compare_url":"https://api.github.com/repos/IshidaHIRO/SDD3/compare/{base}...{head}","merges_url":"https://api.github.com/repos/IshidaHIRO/SDD3/merges","archive_url":"https://api.github.com/repos/IshidaHIRO/SDD3/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/IshidaHIRO/SDD3/downloads","issues_url":"https://api.github.com/repos/IshidaHIRO/SDD3/issues{/number}","pulls_url":"https://api.github.com/repos/IshidaHIRO/SDD3/pulls{/number}","milestones_url":"https://api.github.com/repos/IshidaHIRO/SDD3/milestones{/number}","notifications_url":"https://api.github.com/repos/IshidaHIRO/SDD3/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/IshidaHIRO/SDD3/labels{/name}","releases_url":"https://api.github.com/repos/IshidaHIRO/SDD3/releases{/id}","deployments_url":"https://api.github.com/repos/IshidaHIRO/SDD3/deployments","created_at":"2016-09-29T10:08:01Z","updated_at":"2016-10-15T04:52:52Z","pushed_at":"2016-10-23T15:58:47Z","git_url":"git://github.com/IshidaHIRO/SDD3.git","ssh_url":"git@github.com:IshidaHIRO/SDD3.git","clone_url":"https://github.com/IshidaHIRO/SDD3.git","svn_url":"https://github.com/IshidaHIRO/SDD3","homepage":null,"size":2561,"stargazers_count":3,"watchers_count":3,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":15,"forks":0,"open_issues":15,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/IshidaHIRO/SDD3/pulls/61"},"html":{"href":"https://github.com/IshidaHIRO/SDD3/pull/61"},"issue":{"href":"https://api.github.com/repos/IshidaHIRO/SDD3/issues/61"},"comments":{"href":"https://api.github.com/repos/IshidaHIRO/SDD3/issues/61/comments"},"review_comments":{"href":"https://api.github.com/repos/IshidaHIRO/SDD3/pulls/61/comments"},"review_comment":{"href":"https://api.github.com/repos/IshidaHIRO/SDD3/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/IshidaHIRO/SDD3/pulls/61/commits"},"statuses":{"href":"https://api.github.com/repos/IshidaHIRO/SDD3/statuses/6dceb4cafc5c554599829b121b836faf9c794428"}}}}
{"actor":{"display_login":"tantan5"}}