{"action":"created","comment":{"url":"https://api.github.com/repos/ogonzal87/talkative_robot/pulls/comments/22975237","id":22975237,"diff_hunk":"@@ -0,0 +1,133 @@\n+#Talktive Robot\n+\n+# - Ask user for gender (M or F) \n+\n+print \"What's your gender? (M/F): \"\n+gender = gets.chomp\n+\n+# - Print a message based off age X\n+print \"How old are you?: \"\n+age = gets.chomp.to_i\n+puts \"Your are #{age} years old\"\n+\n+# # # - Using in-line if X\n+# puts \"Welcome to WDI! Could I see your ID, please?\"\n+# puts \"Unfortunately, we don't let people in who are less than 21\" if age < \t21 \n+# puts \"Please, come in!\" \t\t\t\t\t\t\t\t\t\t  if age >= 21\n+# #**OR**\n+# Add a ternary operator somewhere\n+# puts age < 21 ? \"Unfortunately, we don't let people in who are less than 21\" : \"Please, come in!\"\n+\n+# # - Using in-line unless X\n+# puts \"Wait! how old is your friend?!\"\n+# friend_age = gets.chomp.to_i\n+# puts \"Unfortunately, we don't let people in who are less than 21\" unless friend_age >= 21\n+# puts \"Welcome!\" unless friend_age < 21 \n+\n+# - if/else \n+# if age < 21 \n+# \tputs \"Unfortunately, we don't let people in who are less than 21\"\n+# elsif age >= 21 \n+# \tputs \"Welcome!\"\n+# end\n+\n+# # - Case (if < 75 “You’ll be 75 in x years”, == 75 (you’re 75!), > 75 “You turned 75 y years ago”) X\n+# case age \n+# when 75..75\n+# \tputs \"You're 75!\"\n+# when 0..75\n+# \tage_delta_minus = (75 -  age)\n+# \tputs \"You'll be 75 in #{age_delta_minus} years\" \n+# when 75..300\n+# \tage_delta_plus = (age - 75)\n+# \tputs \"You turned 75 #{age_delta_plus} ago\"\n+# else \n+# \tputs \"You're dead!\"\n+# end\n+\n+# - Display messages based on both age and gender\n+# \t- “You are a young boy/girl.”\n+# # - “Are you a great-great grandmother/father?” (make sure age is very high!)\n+# gender = \"boy\"  \t\t\t\t\tif gender == \"M\" && age \t\t<= 10 \n+# gender = \"girl\" \t\t\t\t\tif gender == \"F\" && age \t\t<= 10\n+# gender = \"Man\"  \t\t\t\t\tif gender == \"M\" && age.between?(11, 150) \n+# gender = \"Lady\" \t\t\t\t\tif gender == \"F\" && age.between?(11, 150)\n+# gender = \"great-great grandmother\"\tif gender == \"F\" && age \t\t> 150\n+# gender = \"great-great grandfather\"\tif gender == \"M\" && age \t\t> 150 \n+\n+# puts \"you are a young #{gender}!\" \tif age \t\t\t\t\t<= 10  && gender == \"boy\"\n+# puts \"You are a young #{gender}!\" \tif age \t\t\t\t\t<= 10  && gender == \"girl\"\n+# puts \"You are an old #{gender}!\" \tif age.between?(11, 150) \t   && gender == \"Man\"\n+# puts \"You are an old #{gender}!\" \tif age.between?(11, 150) \t   && gender == \"Lady\"\t\n+# puts \"Are you a #{gender}?\"\t\t\tif age \t\t\t \t\t>= 151 && gender == \"great-great grandmother\"\n+# puts \"Are you a #{gender}?\"\t\t\tif age \t\t\t\t\t>= 151 && gender == \"great-great grandfather\"\t\n+\n+\n+# Group previously defined if/else and case statements into methods\n+\n+# - if/else \n+def entrance_denial?(age)\n+ age <= 10\n+end\n+\n+def entrance_acceptance?(age)\n+ age > 10\n+end\n+\n+puts \"Unfortunately, we don't let people in who are less than 21\" if entrance_denial?(age) \n+puts \"Welcome!\" if entrance_acceptance?(age)\n+\n+\n+\n+\n+ # - Case (if < 75 “You’ll be 75 in x years”, == 75 (you’re 75!), > 75 “You turned 75 y years ago”) X\n+# case age \n+# when 75..75\n+# \tputs \"You're 75!\"\n+# when 0..75\n+# \tage_delta_minus = (75 -  age)\n+# \tputs \"You'll be 75 in #{age_delta_minus} years\" \n+# when 75..300\n+# \tage_delta_plus = (age - 75)\n+# \tputs \"You turned 75 #{age_delta_plus} ago\"\n+# else \n+# \tputs \"You're dead!\"\n+#end\n+def younger_than_75?(age)\n+  age.between?(0, 75)\n+end\n+\n+def older_than_75?(age)\n+  age.between?(75, 300)\n+end\n+  \n+def same_as_75?(age)\n+\tif age == 75\n+  end  ","path":"talkative_robot_osk_methods.rb","position":106,"original_position":106,"commit_id":"ee2d7d38240155dfe1f0c2b5224f98c72d943d3e","original_commit_id":"ee2d7d38240155dfe1f0c2b5224f98c72d943d3e","user":{"login":"rgpass","id":4154682,"avatar_url":"https://avatars.githubusercontent.com/u/4154682?v=3","gravatar_id":"","url":"https://api.github.com/users/rgpass","html_url":"https://github.com/rgpass","followers_url":"https://api.github.com/users/rgpass/followers","following_url":"https://api.github.com/users/rgpass/following{/other_user}","gists_url":"https://api.github.com/users/rgpass/gists{/gist_id}","starred_url":"https://api.github.com/users/rgpass/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rgpass/subscriptions","organizations_url":"https://api.github.com/users/rgpass/orgs","repos_url":"https://api.github.com/users/rgpass/repos","events_url":"https://api.github.com/users/rgpass/events{/privacy}","received_events_url":"https://api.github.com/users/rgpass/received_events","type":"User","site_admin":false},"body":"? Missing something?","created_at":"2015-01-14T22:16:25Z","updated_at":"2015-01-14T22:16:25Z","html_url":"https://github.com/ogonzal87/talkative_robot/pull/2#discussion_r22975237","pull_request_url":"https://api.github.com/repos/ogonzal87/talkative_robot/pulls/2","_links":{"self":{"href":"https://api.github.com/repos/ogonzal87/talkative_robot/pulls/comments/22975237"},"html":{"href":"https://github.com/ogonzal87/talkative_robot/pull/2#discussion_r22975237"},"pull_request":{"href":"https://api.github.com/repos/ogonzal87/talkative_robot/pulls/2"}}},"pull_request":{"url":"https://api.github.com/repos/ogonzal87/talkative_robot/pulls/2","id":27386859,"html_url":"https://github.com/ogonzal87/talkative_robot/pull/2","diff_url":"https://github.com/ogonzal87/talkative_robot/pull/2.diff","patch_url":"https://github.com/ogonzal87/talkative_robot/pull/2.patch","issue_url":"https://api.github.com/repos/ogonzal87/talkative_robot/issues/2","number":2,"state":"open","locked":false,"title":"Finished Methods Lab","user":{"login":"ogonzal87","id":10442715,"avatar_url":"https://avatars.githubusercontent.com/u/10442715?v=3","gravatar_id":"","url":"https://api.github.com/users/ogonzal87","html_url":"https://github.com/ogonzal87","followers_url":"https://api.github.com/users/ogonzal87/followers","following_url":"https://api.github.com/users/ogonzal87/following{/other_user}","gists_url":"https://api.github.com/users/ogonzal87/gists{/gist_id}","starred_url":"https://api.github.com/users/ogonzal87/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ogonzal87/subscriptions","organizations_url":"https://api.github.com/users/ogonzal87/orgs","repos_url":"https://api.github.com/users/ogonzal87/repos","events_url":"https://api.github.com/users/ogonzal87/events{/privacy}","received_events_url":"https://api.github.com/users/ogonzal87/received_events","type":"User","site_admin":false},"body":"{\r\n  \"comfortability\": 3,\r\n  \"completeness\": 4,\r\n  \"questions\": \"I know what a method does but I do not feel comfortable with the how methods work with conditionals like \"case\" in the example below. I could not figure it out. Also, I am still unsure as to the need for \"return\" in some cases and not in others.\r\n\r\n# - Case (if < 75 “You’ll be 75 in x years”, == 75 (you’re 75!), > 75 “You turned 75 y years ago”) X\r\n case age \r\n when 75..75\r\n \tputs \"You're 75!\"\r\n when 0..75\r\n \tage_delta_minus = (75 -  age)\r\n \tputs \"You'll be 75 in #{age_delta_minus} years\" \r\n when 75..300\r\n \tage_delta_plus = (age - 75)\r\n \tputs \"You turned 75 #{age_delta_plus} ago\"\r\n else \r\n \tputs \"You're dead!\"\r\nend\r\n}","created_at":"2015-01-14T21:53:38Z","updated_at":"2015-01-14T22:16:25Z","closed_at":null,"merged_at":null,"merge_commit_sha":"636d52bd2eb7c212d3825c808451cb6d76c9dc5e","assignee":{"login":"rgpass","id":4154682,"avatar_url":"https://avatars.githubusercontent.com/u/4154682?v=3","gravatar_id":"","url":"https://api.github.com/users/rgpass","html_url":"https://github.com/rgpass","followers_url":"https://api.github.com/users/rgpass/followers","following_url":"https://api.github.com/users/rgpass/following{/other_user}","gists_url":"https://api.github.com/users/rgpass/gists{/gist_id}","starred_url":"https://api.github.com/users/rgpass/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rgpass/subscriptions","organizations_url":"https://api.github.com/users/rgpass/orgs","repos_url":"https://api.github.com/users/rgpass/repos","events_url":"https://api.github.com/users/rgpass/events{/privacy}","received_events_url":"https://api.github.com/users/rgpass/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/ogonzal87/talkative_robot/pulls/2/commits","review_comments_url":"https://api.github.com/repos/ogonzal87/talkative_robot/pulls/2/comments","review_comment_url":"https://api.github.com/repos/ogonzal87/talkative_robot/pulls/comments/{number}","comments_url":"https://api.github.com/repos/ogonzal87/talkative_robot/issues/2/comments","statuses_url":"https://api.github.com/repos/ogonzal87/talkative_robot/statuses/ee2d7d38240155dfe1f0c2b5224f98c72d943d3e","head":{"label":"ogonzal87:methods_lab","ref":"methods_lab","sha":"ee2d7d38240155dfe1f0c2b5224f98c72d943d3e","user":{"login":"ogonzal87","id":10442715,"avatar_url":"https://avatars.githubusercontent.com/u/10442715?v=3","gravatar_id":"","url":"https://api.github.com/users/ogonzal87","html_url":"https://github.com/ogonzal87","followers_url":"https://api.github.com/users/ogonzal87/followers","following_url":"https://api.github.com/users/ogonzal87/following{/other_user}","gists_url":"https://api.github.com/users/ogonzal87/gists{/gist_id}","starred_url":"https://api.github.com/users/ogonzal87/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ogonzal87/subscriptions","organizations_url":"https://api.github.com/users/ogonzal87/orgs","repos_url":"https://api.github.com/users/ogonzal87/repos","events_url":"https://api.github.com/users/ogonzal87/events{/privacy}","received_events_url":"https://api.github.com/users/ogonzal87/received_events","type":"User","site_admin":false},"repo":{"id":29248264,"name":"talkative_robot","full_name":"ogonzal87/talkative_robot","owner":{"login":"ogonzal87","id":10442715,"avatar_url":"https://avatars.githubusercontent.com/u/10442715?v=3","gravatar_id":"","url":"https://api.github.com/users/ogonzal87","html_url":"https://github.com/ogonzal87","followers_url":"https://api.github.com/users/ogonzal87/followers","following_url":"https://api.github.com/users/ogonzal87/following{/other_user}","gists_url":"https://api.github.com/users/ogonzal87/gists{/gist_id}","starred_url":"https://api.github.com/users/ogonzal87/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ogonzal87/subscriptions","organizations_url":"https://api.github.com/users/ogonzal87/orgs","repos_url":"https://api.github.com/users/ogonzal87/repos","events_url":"https://api.github.com/users/ogonzal87/events{/privacy}","received_events_url":"https://api.github.com/users/ogonzal87/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ogonzal87/talkative_robot","description":"","fork":false,"url":"https://api.github.com/repos/ogonzal87/talkative_robot","forks_url":"https://api.github.com/repos/ogonzal87/talkative_robot/forks","keys_url":"https://api.github.com/repos/ogonzal87/talkative_robot/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ogonzal87/talkative_robot/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ogonzal87/talkative_robot/teams","hooks_url":"https://api.github.com/repos/ogonzal87/talkative_robot/hooks","issue_events_url":"https://api.github.com/repos/ogonzal87/talkative_robot/issues/events{/number}","events_url":"https://api.github.com/repos/ogonzal87/talkative_robot/events","assignees_url":"https://api.github.com/repos/ogonzal87/talkative_robot/assignees{/user}","branches_url":"https://api.github.com/repos/ogonzal87/talkative_robot/branches{/branch}","tags_url":"https://api.github.com/repos/ogonzal87/talkative_robot/tags","blobs_url":"https://api.github.com/repos/ogonzal87/talkative_robot/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ogonzal87/talkative_robot/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ogonzal87/talkative_robot/git/refs{/sha}","trees_url":"https://api.github.com/repos/ogonzal87/talkative_robot/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ogonzal87/talkative_robot/statuses/{sha}","languages_url":"https://api.github.com/repos/ogonzal87/talkative_robot/languages","stargazers_url":"https://api.github.com/repos/ogonzal87/talkative_robot/stargazers","contributors_url":"https://api.github.com/repos/ogonzal87/talkative_robot/contributors","subscribers_url":"https://api.github.com/repos/ogonzal87/talkative_robot/subscribers","subscription_url":"https://api.github.com/repos/ogonzal87/talkative_robot/subscription","commits_url":"https://api.github.com/repos/ogonzal87/talkative_robot/commits{/sha}","git_commits_url":"https://api.github.com/repos/ogonzal87/talkative_robot/git/commits{/sha}","comments_url":"https://api.github.com/repos/ogonzal87/talkative_robot/comments{/number}","issue_comment_url":"https://api.github.com/repos/ogonzal87/talkative_robot/issues/comments/{number}","contents_url":"https://api.github.com/repos/ogonzal87/talkative_robot/contents/{+path}","compare_url":"https://api.github.com/repos/ogonzal87/talkative_robot/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ogonzal87/talkative_robot/merges","archive_url":"https://api.github.com/repos/ogonzal87/talkative_robot/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ogonzal87/talkative_robot/downloads","issues_url":"https://api.github.com/repos/ogonzal87/talkative_robot/issues{/number}","pulls_url":"https://api.github.com/repos/ogonzal87/talkative_robot/pulls{/number}","milestones_url":"https://api.github.com/repos/ogonzal87/talkative_robot/milestones{/number}","notifications_url":"https://api.github.com/repos/ogonzal87/talkative_robot/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ogonzal87/talkative_robot/labels{/name}","releases_url":"https://api.github.com/repos/ogonzal87/talkative_robot/releases{/id}","created_at":"2015-01-14T14:35:22Z","updated_at":"2015-01-14T19:11:15Z","pushed_at":"2015-01-14T21:44:46Z","git_url":"git://github.com/ogonzal87/talkative_robot.git","ssh_url":"git@github.com:ogonzal87/talkative_robot.git","clone_url":"https://github.com/ogonzal87/talkative_robot.git","svn_url":"https://github.com/ogonzal87/talkative_robot","homepage":null,"size":0,"stargazers_count":0,"watchers_count":0,"language":"Ruby","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":"ogonzal87:master","ref":"master","sha":"b61894d78e12d024761f063a7416db1e7684d929","user":{"login":"ogonzal87","id":10442715,"avatar_url":"https://avatars.githubusercontent.com/u/10442715?v=3","gravatar_id":"","url":"https://api.github.com/users/ogonzal87","html_url":"https://github.com/ogonzal87","followers_url":"https://api.github.com/users/ogonzal87/followers","following_url":"https://api.github.com/users/ogonzal87/following{/other_user}","gists_url":"https://api.github.com/users/ogonzal87/gists{/gist_id}","starred_url":"https://api.github.com/users/ogonzal87/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ogonzal87/subscriptions","organizations_url":"https://api.github.com/users/ogonzal87/orgs","repos_url":"https://api.github.com/users/ogonzal87/repos","events_url":"https://api.github.com/users/ogonzal87/events{/privacy}","received_events_url":"https://api.github.com/users/ogonzal87/received_events","type":"User","site_admin":false},"repo":{"id":29248264,"name":"talkative_robot","full_name":"ogonzal87/talkative_robot","owner":{"login":"ogonzal87","id":10442715,"avatar_url":"https://avatars.githubusercontent.com/u/10442715?v=3","gravatar_id":"","url":"https://api.github.com/users/ogonzal87","html_url":"https://github.com/ogonzal87","followers_url":"https://api.github.com/users/ogonzal87/followers","following_url":"https://api.github.com/users/ogonzal87/following{/other_user}","gists_url":"https://api.github.com/users/ogonzal87/gists{/gist_id}","starred_url":"https://api.github.com/users/ogonzal87/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ogonzal87/subscriptions","organizations_url":"https://api.github.com/users/ogonzal87/orgs","repos_url":"https://api.github.com/users/ogonzal87/repos","events_url":"https://api.github.com/users/ogonzal87/events{/privacy}","received_events_url":"https://api.github.com/users/ogonzal87/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ogonzal87/talkative_robot","description":"","fork":false,"url":"https://api.github.com/repos/ogonzal87/talkative_robot","forks_url":"https://api.github.com/repos/ogonzal87/talkative_robot/forks","keys_url":"https://api.github.com/repos/ogonzal87/talkative_robot/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ogonzal87/talkative_robot/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ogonzal87/talkative_robot/teams","hooks_url":"https://api.github.com/repos/ogonzal87/talkative_robot/hooks","issue_events_url":"https://api.github.com/repos/ogonzal87/talkative_robot/issues/events{/number}","events_url":"https://api.github.com/repos/ogonzal87/talkative_robot/events","assignees_url":"https://api.github.com/repos/ogonzal87/talkative_robot/assignees{/user}","branches_url":"https://api.github.com/repos/ogonzal87/talkative_robot/branches{/branch}","tags_url":"https://api.github.com/repos/ogonzal87/talkative_robot/tags","blobs_url":"https://api.github.com/repos/ogonzal87/talkative_robot/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ogonzal87/talkative_robot/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ogonzal87/talkative_robot/git/refs{/sha}","trees_url":"https://api.github.com/repos/ogonzal87/talkative_robot/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ogonzal87/talkative_robot/statuses/{sha}","languages_url":"https://api.github.com/repos/ogonzal87/talkative_robot/languages","stargazers_url":"https://api.github.com/repos/ogonzal87/talkative_robot/stargazers","contributors_url":"https://api.github.com/repos/ogonzal87/talkative_robot/contributors","subscribers_url":"https://api.github.com/repos/ogonzal87/talkative_robot/subscribers","subscription_url":"https://api.github.com/repos/ogonzal87/talkative_robot/subscription","commits_url":"https://api.github.com/repos/ogonzal87/talkative_robot/commits{/sha}","git_commits_url":"https://api.github.com/repos/ogonzal87/talkative_robot/git/commits{/sha}","comments_url":"https://api.github.com/repos/ogonzal87/talkative_robot/comments{/number}","issue_comment_url":"https://api.github.com/repos/ogonzal87/talkative_robot/issues/comments/{number}","contents_url":"https://api.github.com/repos/ogonzal87/talkative_robot/contents/{+path}","compare_url":"https://api.github.com/repos/ogonzal87/talkative_robot/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ogonzal87/talkative_robot/merges","archive_url":"https://api.github.com/repos/ogonzal87/talkative_robot/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ogonzal87/talkative_robot/downloads","issues_url":"https://api.github.com/repos/ogonzal87/talkative_robot/issues{/number}","pulls_url":"https://api.github.com/repos/ogonzal87/talkative_robot/pulls{/number}","milestones_url":"https://api.github.com/repos/ogonzal87/talkative_robot/milestones{/number}","notifications_url":"https://api.github.com/repos/ogonzal87/talkative_robot/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ogonzal87/talkative_robot/labels{/name}","releases_url":"https://api.github.com/repos/ogonzal87/talkative_robot/releases{/id}","created_at":"2015-01-14T14:35:22Z","updated_at":"2015-01-14T19:11:15Z","pushed_at":"2015-01-14T21:44:46Z","git_url":"git://github.com/ogonzal87/talkative_robot.git","ssh_url":"git@github.com:ogonzal87/talkative_robot.git","clone_url":"https://github.com/ogonzal87/talkative_robot.git","svn_url":"https://github.com/ogonzal87/talkative_robot","homepage":null,"size":0,"stargazers_count":0,"watchers_count":0,"language":"Ruby","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/ogonzal87/talkative_robot/pulls/2"},"html":{"href":"https://github.com/ogonzal87/talkative_robot/pull/2"},"issue":{"href":"https://api.github.com/repos/ogonzal87/talkative_robot/issues/2"},"comments":{"href":"https://api.github.com/repos/ogonzal87/talkative_robot/issues/2/comments"},"review_comments":{"href":"https://api.github.com/repos/ogonzal87/talkative_robot/pulls/2/comments"},"review_comment":{"href":"https://api.github.com/repos/ogonzal87/talkative_robot/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/ogonzal87/talkative_robot/pulls/2/commits"},"statuses":{"href":"https://api.github.com/repos/ogonzal87/talkative_robot/statuses/ee2d7d38240155dfe1f0c2b5224f98c72d943d3e"}}}}