{"action":"created","comment":{"url":"https://api.github.com/repos/offthread/pphoje_bot/pulls/comments/63929809","id":63929809,"diff_hunk":"@@ -10,73 +10,42 @@ def start(*)\n   end\n \n   def shows(*args)\n-    endingDate = Date.parse(END_DATE_STRING, t(:date_format))\n-\n     # If arguments is not empty, check if it's a number or a string\n     if args.any?\n-      #Day informed as a number\n-      if args[0].match(NUMBER_REGULAR_EXPRESSION)\n-        dayFromArgs = args[0].to_s.rjust(2, '0')\n-        errorMessage = validateDayFromMonth(dayFromArgs.to_i)\n-      elsif args[0].is_a? String\n-        #Day informed as a string (monday, tuesday...)\n-        dayFromArgs = getDayFromString(args[0].to_s)\n-      else\n-        #Command does not match anything\n-        errorMessage = MESSAGE_CHECK_USAGE_COMMAND\n-      end\n+\n+      selectedDay, argsTypeErrorMessage, selectedMonth = getArgsFromCommand(*args)\n \n       # Return immediately if an error message was caught\n-      if errorMessage\n-        reply_with :message, text: errorMessage\n+      if argsTypeErrorMessage\n+        replyWithText(argsTypeErrorMessage)\n         return\n-      end\n-\n-      if not dayFromArgs\n-        reply_with :message, text: t(:error_invalid_weekday)\n+      elsif selectedDay.nil?","path":"app/controllers/telegram_webhooks_controller.rb","position":null,"original_position":32,"commit_id":"9361e845d48b08ce36823519633cc4787d974e75","original_commit_id":"6c7aa35d8b969870cf3908026060ebbaa791423f","user":{"login":"felipevieira","id":228709,"avatar_url":"https://avatars.githubusercontent.com/u/228709?v=3","gravatar_id":"","url":"https://api.github.com/users/felipevieira","html_url":"https://github.com/felipevieira","followers_url":"https://api.github.com/users/felipevieira/followers","following_url":"https://api.github.com/users/felipevieira/following{/other_user}","gists_url":"https://api.github.com/users/felipevieira/gists{/gist_id}","starred_url":"https://api.github.com/users/felipevieira/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/felipevieira/subscriptions","organizations_url":"https://api.github.com/users/felipevieira/orgs","repos_url":"https://api.github.com/users/felipevieira/repos","events_url":"https://api.github.com/users/felipevieira/events{/privacy}","received_events_url":"https://api.github.com/users/felipevieira/received_events","type":"User","site_admin":false},"body":"@filipecosta01 maybe it's just me but I think that avoid using nil, null or other keywords helps on code \r\nreadability.. but there's no obligation to change it right now","created_at":"2016-05-19T18:23:37Z","updated_at":"2016-05-19T18:23:38Z","html_url":"https://github.com/offthread/pphoje_bot/pull/18#discussion_r63929809","pull_request_url":"https://api.github.com/repos/offthread/pphoje_bot/pulls/18","_links":{"self":{"href":"https://api.github.com/repos/offthread/pphoje_bot/pulls/comments/63929809"},"html":{"href":"https://github.com/offthread/pphoje_bot/pull/18#discussion_r63929809"},"pull_request":{"href":"https://api.github.com/repos/offthread/pphoje_bot/pulls/18"}}},"pull_request":{"url":"https://api.github.com/repos/offthread/pphoje_bot/pulls/18","id":70516365,"html_url":"https://github.com/offthread/pphoje_bot/pull/18","diff_url":"https://github.com/offthread/pphoje_bot/pull/18.diff","patch_url":"https://github.com/offthread/pphoje_bot/pull/18.patch","issue_url":"https://api.github.com/repos/offthread/pphoje_bot/issues/18","number":18,"state":"open","locked":false,"title":"Including more methods","user":{"login":"filipecosta01","id":2905403,"avatar_url":"https://avatars.githubusercontent.com/u/2905403?v=3","gravatar_id":"","url":"https://api.github.com/users/filipecosta01","html_url":"https://github.com/filipecosta01","followers_url":"https://api.github.com/users/filipecosta01/followers","following_url":"https://api.github.com/users/filipecosta01/following{/other_user}","gists_url":"https://api.github.com/users/filipecosta01/gists{/gist_id}","starred_url":"https://api.github.com/users/filipecosta01/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/filipecosta01/subscriptions","organizations_url":"https://api.github.com/users/filipecosta01/orgs","repos_url":"https://api.github.com/users/filipecosta01/repos","events_url":"https://api.github.com/users/filipecosta01/events{/privacy}","received_events_url":"https://api.github.com/users/filipecosta01/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-05-18T12:11:02Z","updated_at":"2016-05-19T18:23:38Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2bcb185ed7ebb2ae9f19b043dbd7b4c6d189bf6a","assignee":{"login":"felipevieira","id":228709,"avatar_url":"https://avatars.githubusercontent.com/u/228709?v=3","gravatar_id":"","url":"https://api.github.com/users/felipevieira","html_url":"https://github.com/felipevieira","followers_url":"https://api.github.com/users/felipevieira/followers","following_url":"https://api.github.com/users/felipevieira/following{/other_user}","gists_url":"https://api.github.com/users/felipevieira/gists{/gist_id}","starred_url":"https://api.github.com/users/felipevieira/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/felipevieira/subscriptions","organizations_url":"https://api.github.com/users/felipevieira/orgs","repos_url":"https://api.github.com/users/felipevieira/repos","events_url":"https://api.github.com/users/felipevieira/events{/privacy}","received_events_url":"https://api.github.com/users/felipevieira/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/offthread/pphoje_bot/pulls/18/commits","review_comments_url":"https://api.github.com/repos/offthread/pphoje_bot/pulls/18/comments","review_comment_url":"https://api.github.com/repos/offthread/pphoje_bot/pulls/comments{/number}","comments_url":"https://api.github.com/repos/offthread/pphoje_bot/issues/18/comments","statuses_url":"https://api.github.com/repos/offthread/pphoje_bot/statuses/9361e845d48b08ce36823519633cc4787d974e75","head":{"label":"offthread:pphoje/code_refactoring","ref":"pphoje/code_refactoring","sha":"9361e845d48b08ce36823519633cc4787d974e75","user":{"login":"offthread","id":16636620,"avatar_url":"https://avatars.githubusercontent.com/u/16636620?v=3","gravatar_id":"","url":"https://api.github.com/users/offthread","html_url":"https://github.com/offthread","followers_url":"https://api.github.com/users/offthread/followers","following_url":"https://api.github.com/users/offthread/following{/other_user}","gists_url":"https://api.github.com/users/offthread/gists{/gist_id}","starred_url":"https://api.github.com/users/offthread/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/offthread/subscriptions","organizations_url":"https://api.github.com/users/offthread/orgs","repos_url":"https://api.github.com/users/offthread/repos","events_url":"https://api.github.com/users/offthread/events{/privacy}","received_events_url":"https://api.github.com/users/offthread/received_events","type":"Organization","site_admin":false},"repo":{"id":58964474,"name":"pphoje_bot","full_name":"offthread/pphoje_bot","owner":{"login":"offthread","id":16636620,"avatar_url":"https://avatars.githubusercontent.com/u/16636620?v=3","gravatar_id":"","url":"https://api.github.com/users/offthread","html_url":"https://github.com/offthread","followers_url":"https://api.github.com/users/offthread/followers","following_url":"https://api.github.com/users/offthread/following{/other_user}","gists_url":"https://api.github.com/users/offthread/gists{/gist_id}","starred_url":"https://api.github.com/users/offthread/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/offthread/subscriptions","organizations_url":"https://api.github.com/users/offthread/orgs","repos_url":"https://api.github.com/users/offthread/repos","events_url":"https://api.github.com/users/offthread/events{/privacy}","received_events_url":"https://api.github.com/users/offthread/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/offthread/pphoje_bot","description":"Telegram Bot using Rails to inform the events of Parque do Povo - Campina Grande/PB","fork":false,"url":"https://api.github.com/repos/offthread/pphoje_bot","forks_url":"https://api.github.com/repos/offthread/pphoje_bot/forks","keys_url":"https://api.github.com/repos/offthread/pphoje_bot/keys{/key_id}","collaborators_url":"https://api.github.com/repos/offthread/pphoje_bot/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/offthread/pphoje_bot/teams","hooks_url":"https://api.github.com/repos/offthread/pphoje_bot/hooks","issue_events_url":"https://api.github.com/repos/offthread/pphoje_bot/issues/events{/number}","events_url":"https://api.github.com/repos/offthread/pphoje_bot/events","assignees_url":"https://api.github.com/repos/offthread/pphoje_bot/assignees{/user}","branches_url":"https://api.github.com/repos/offthread/pphoje_bot/branches{/branch}","tags_url":"https://api.github.com/repos/offthread/pphoje_bot/tags","blobs_url":"https://api.github.com/repos/offthread/pphoje_bot/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/offthread/pphoje_bot/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/offthread/pphoje_bot/git/refs{/sha}","trees_url":"https://api.github.com/repos/offthread/pphoje_bot/git/trees{/sha}","statuses_url":"https://api.github.com/repos/offthread/pphoje_bot/statuses/{sha}","languages_url":"https://api.github.com/repos/offthread/pphoje_bot/languages","stargazers_url":"https://api.github.com/repos/offthread/pphoje_bot/stargazers","contributors_url":"https://api.github.com/repos/offthread/pphoje_bot/contributors","subscribers_url":"https://api.github.com/repos/offthread/pphoje_bot/subscribers","subscription_url":"https://api.github.com/repos/offthread/pphoje_bot/subscription","commits_url":"https://api.github.com/repos/offthread/pphoje_bot/commits{/sha}","git_commits_url":"https://api.github.com/repos/offthread/pphoje_bot/git/commits{/sha}","comments_url":"https://api.github.com/repos/offthread/pphoje_bot/comments{/number}","issue_comment_url":"https://api.github.com/repos/offthread/pphoje_bot/issues/comments{/number}","contents_url":"https://api.github.com/repos/offthread/pphoje_bot/contents/{+path}","compare_url":"https://api.github.com/repos/offthread/pphoje_bot/compare/{base}...{head}","merges_url":"https://api.github.com/repos/offthread/pphoje_bot/merges","archive_url":"https://api.github.com/repos/offthread/pphoje_bot/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/offthread/pphoje_bot/downloads","issues_url":"https://api.github.com/repos/offthread/pphoje_bot/issues{/number}","pulls_url":"https://api.github.com/repos/offthread/pphoje_bot/pulls{/number}","milestones_url":"https://api.github.com/repos/offthread/pphoje_bot/milestones{/number}","notifications_url":"https://api.github.com/repos/offthread/pphoje_bot/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/offthread/pphoje_bot/labels{/name}","releases_url":"https://api.github.com/repos/offthread/pphoje_bot/releases{/id}","deployments_url":"https://api.github.com/repos/offthread/pphoje_bot/deployments","created_at":"2016-05-16T20:17:55Z","updated_at":"2016-05-19T18:21:12Z","pushed_at":"2016-05-19T15:58:00Z","git_url":"git://github.com/offthread/pphoje_bot.git","ssh_url":"git@github.com:offthread/pphoje_bot.git","clone_url":"https://github.com/offthread/pphoje_bot.git","svn_url":"https://github.com/offthread/pphoje_bot","homepage":null,"size":72,"stargazers_count":2,"watchers_count":2,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":4,"forks":0,"open_issues":4,"watchers":2,"default_branch":"development"}},"base":{"label":"offthread:development","ref":"development","sha":"e6b3ca9eb48824483282d67903240dcd13dc1174","user":{"login":"offthread","id":16636620,"avatar_url":"https://avatars.githubusercontent.com/u/16636620?v=3","gravatar_id":"","url":"https://api.github.com/users/offthread","html_url":"https://github.com/offthread","followers_url":"https://api.github.com/users/offthread/followers","following_url":"https://api.github.com/users/offthread/following{/other_user}","gists_url":"https://api.github.com/users/offthread/gists{/gist_id}","starred_url":"https://api.github.com/users/offthread/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/offthread/subscriptions","organizations_url":"https://api.github.com/users/offthread/orgs","repos_url":"https://api.github.com/users/offthread/repos","events_url":"https://api.github.com/users/offthread/events{/privacy}","received_events_url":"https://api.github.com/users/offthread/received_events","type":"Organization","site_admin":false},"repo":{"id":58964474,"name":"pphoje_bot","full_name":"offthread/pphoje_bot","owner":{"login":"offthread","id":16636620,"avatar_url":"https://avatars.githubusercontent.com/u/16636620?v=3","gravatar_id":"","url":"https://api.github.com/users/offthread","html_url":"https://github.com/offthread","followers_url":"https://api.github.com/users/offthread/followers","following_url":"https://api.github.com/users/offthread/following{/other_user}","gists_url":"https://api.github.com/users/offthread/gists{/gist_id}","starred_url":"https://api.github.com/users/offthread/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/offthread/subscriptions","organizations_url":"https://api.github.com/users/offthread/orgs","repos_url":"https://api.github.com/users/offthread/repos","events_url":"https://api.github.com/users/offthread/events{/privacy}","received_events_url":"https://api.github.com/users/offthread/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/offthread/pphoje_bot","description":"Telegram Bot using Rails to inform the events of Parque do Povo - Campina Grande/PB","fork":false,"url":"https://api.github.com/repos/offthread/pphoje_bot","forks_url":"https://api.github.com/repos/offthread/pphoje_bot/forks","keys_url":"https://api.github.com/repos/offthread/pphoje_bot/keys{/key_id}","collaborators_url":"https://api.github.com/repos/offthread/pphoje_bot/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/offthread/pphoje_bot/teams","hooks_url":"https://api.github.com/repos/offthread/pphoje_bot/hooks","issue_events_url":"https://api.github.com/repos/offthread/pphoje_bot/issues/events{/number}","events_url":"https://api.github.com/repos/offthread/pphoje_bot/events","assignees_url":"https://api.github.com/repos/offthread/pphoje_bot/assignees{/user}","branches_url":"https://api.github.com/repos/offthread/pphoje_bot/branches{/branch}","tags_url":"https://api.github.com/repos/offthread/pphoje_bot/tags","blobs_url":"https://api.github.com/repos/offthread/pphoje_bot/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/offthread/pphoje_bot/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/offthread/pphoje_bot/git/refs{/sha}","trees_url":"https://api.github.com/repos/offthread/pphoje_bot/git/trees{/sha}","statuses_url":"https://api.github.com/repos/offthread/pphoje_bot/statuses/{sha}","languages_url":"https://api.github.com/repos/offthread/pphoje_bot/languages","stargazers_url":"https://api.github.com/repos/offthread/pphoje_bot/stargazers","contributors_url":"https://api.github.com/repos/offthread/pphoje_bot/contributors","subscribers_url":"https://api.github.com/repos/offthread/pphoje_bot/subscribers","subscription_url":"https://api.github.com/repos/offthread/pphoje_bot/subscription","commits_url":"https://api.github.com/repos/offthread/pphoje_bot/commits{/sha}","git_commits_url":"https://api.github.com/repos/offthread/pphoje_bot/git/commits{/sha}","comments_url":"https://api.github.com/repos/offthread/pphoje_bot/comments{/number}","issue_comment_url":"https://api.github.com/repos/offthread/pphoje_bot/issues/comments{/number}","contents_url":"https://api.github.com/repos/offthread/pphoje_bot/contents/{+path}","compare_url":"https://api.github.com/repos/offthread/pphoje_bot/compare/{base}...{head}","merges_url":"https://api.github.com/repos/offthread/pphoje_bot/merges","archive_url":"https://api.github.com/repos/offthread/pphoje_bot/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/offthread/pphoje_bot/downloads","issues_url":"https://api.github.com/repos/offthread/pphoje_bot/issues{/number}","pulls_url":"https://api.github.com/repos/offthread/pphoje_bot/pulls{/number}","milestones_url":"https://api.github.com/repos/offthread/pphoje_bot/milestones{/number}","notifications_url":"https://api.github.com/repos/offthread/pphoje_bot/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/offthread/pphoje_bot/labels{/name}","releases_url":"https://api.github.com/repos/offthread/pphoje_bot/releases{/id}","deployments_url":"https://api.github.com/repos/offthread/pphoje_bot/deployments","created_at":"2016-05-16T20:17:55Z","updated_at":"2016-05-19T18:21:12Z","pushed_at":"2016-05-19T15:58:00Z","git_url":"git://github.com/offthread/pphoje_bot.git","ssh_url":"git@github.com:offthread/pphoje_bot.git","clone_url":"https://github.com/offthread/pphoje_bot.git","svn_url":"https://github.com/offthread/pphoje_bot","homepage":null,"size":72,"stargazers_count":2,"watchers_count":2,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":4,"forks":0,"open_issues":4,"watchers":2,"default_branch":"development"}},"_links":{"self":{"href":"https://api.github.com/repos/offthread/pphoje_bot/pulls/18"},"html":{"href":"https://github.com/offthread/pphoje_bot/pull/18"},"issue":{"href":"https://api.github.com/repos/offthread/pphoje_bot/issues/18"},"comments":{"href":"https://api.github.com/repos/offthread/pphoje_bot/issues/18/comments"},"review_comments":{"href":"https://api.github.com/repos/offthread/pphoje_bot/pulls/18/comments"},"review_comment":{"href":"https://api.github.com/repos/offthread/pphoje_bot/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/offthread/pphoje_bot/pulls/18/commits"},"statuses":{"href":"https://api.github.com/repos/offthread/pphoje_bot/statuses/9361e845d48b08ce36823519633cc4787d974e75"}}}}