{"action":"created","comment":{"url":"https://api.github.com/repos/mujtaba7vals/assignment/pulls/comments/195307749","pull_request_review_id":128648044,"id":195307749,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5NTMwNzc0OQ==","diff_hunk":"@@ -0,0 +1,161 @@\n+require 'date'\n+require_relative 'event_details'\n+class EventRecord\n+  @@events_date = {}\n+  @@events_details = {}\n+  @@id = 0\n+  def add_event_details(name, date)\n+    begin\n+      date = date.strip.split(\"-\")\n+      date = DateTime.new(date[0].to_i, date[1].to_i, date[2].to_i)\n+      @@id += 1\n+      @@events_details[@@id] = Event_Details.new(@@id, name, date)\n+      key = date.year.to_s + \"-\" + date.month.to_s\n+      day = date.day\n+      if @@events_date.has_key? (key)\n+        @@events_date[key].push([name, day])\n+      else\n+        @@events_date[key] = Array.new\n+        @@events_date[key].push([name, day])\n+      end\n+      print \"Event added\\n\"\n+      rescue\n+        puts \"Incorrect Data\"\n+    end\n+  end\n+  \n+  def self.return_all_events\n+    if @@events_details.length == 0\n+      puts \"No event added yet\"\n+    else\n+      @@events_details.each do |key, event_detail|\n+        puts \"ID: #{event_detail.id} Name: #{event_detail.name} Date: #{event_detail.date.year}-#{event_detail.date.month}-#{event_detail.date.day} \"\n+    end\n+    end\n+  end\n+  \n+  def self.add_event\n+    EventRecord.new\n+  end\n+  \n+  def self.events_for_given_month\n+    if @@events_details.length == 0\n+      puts \"No event added yet\"\n+    else\n+      begin\n+        print \"Enter the required year (yyyy)\\n\"\n+        year = gets.strip.to_i\n+        print \"Enter the required month (mm)\\n\"\n+        month = gets.strip.to_i\n+        date = DateTime.new(year, month)\n+        key = date.year.to_s + \"-\" + date.month.to_s\n+        if [1, 3, 5, 7, 8, 10, 12].include?(date.month)\n+          range = (1..31)\n+        elsif [4, 6, 9, 11].include?(date.month)\n+          range = (1..30)\n+        else\n+          range = (1..28)\n+        end\n+        temp_event_detail_hash = Hash.new{ |h, k| h[k] = [] }\n+        if @@events_date.has_key? (key)\n+          @@events_date[key].each do |n|\n+            temp_event_detail_hash[n[1].to_i] << n[0]\n+          end\n+          temp_event_detail_hash = temp_event_detail_hash.sort.to_h\n+          print_counter = 0\n+          range.each do |x|\n+            if temp_event_detail_hash.has_key? (x)\n+              print \"#{x}: #{temp_event_detail_hash[x]} \"\n+              print_counter += 1\n+            else\n+              print \"#{x} \\t\"\n+              print_counter += 1\n+            end\n+            if print_counter == 4\n+              print_counter = 0\n+              puts \n+            end\n+          end\n+        else\n+          puts \"No Events Found\"\n+        end\n+      rescue \n+        puts \"Incorrect Data\"\n+      end\n+    end\n+  end\n+\n+   def self.events_for_given_date\n+    if @@events_details.length == 0\n+      puts \"No event added yet\"\n+    else\n+      begin\n+        print \"Enter the required date (yyyy-mm-dd)\\n\"","path":"event_record.rb","position":93,"original_position":93,"commit_id":"1e2da9bf3ac405628c5fb5eae0f8a2f80df9f474","original_commit_id":"1e2da9bf3ac405628c5fb5eae0f8a2f80df9f474","user":{"login":"HassanAkbar","id":5301572,"node_id":"MDQ6VXNlcjUzMDE1NzI=","avatar_url":"https://avatars3.githubusercontent.com/u/5301572?v=4","gravatar_id":"","url":"https://api.github.com/users/HassanAkbar","html_url":"https://github.com/HassanAkbar","followers_url":"https://api.github.com/users/HassanAkbar/followers","following_url":"https://api.github.com/users/HassanAkbar/following{/other_user}","gists_url":"https://api.github.com/users/HassanAkbar/gists{/gist_id}","starred_url":"https://api.github.com/users/HassanAkbar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HassanAkbar/subscriptions","organizations_url":"https://api.github.com/users/HassanAkbar/orgs","repos_url":"https://api.github.com/users/HassanAkbar/repos","events_url":"https://api.github.com/users/HassanAkbar/events{/privacy}","received_events_url":"https://api.github.com/users/HassanAkbar/received_events","type":"User","site_admin":false},"body":"try to make code less redundant.\r\nMake a function for common functionality and call the functions","created_at":"2018-06-14T05:47:56Z","updated_at":"2018-06-14T05:47:56Z","html_url":"https://github.com/mujtaba7vals/assignment/pull/1#discussion_r195307749","pull_request_url":"https://api.github.com/repos/mujtaba7vals/assignment/pulls/1","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/mujtaba7vals/assignment/pulls/comments/195307749"},"html":{"href":"https://github.com/mujtaba7vals/assignment/pull/1#discussion_r195307749"},"pull_request":{"href":"https://api.github.com/repos/mujtaba7vals/assignment/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/mujtaba7vals/assignment/pulls/1","id":194484361,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk0NDg0MzYx","html_url":"https://github.com/mujtaba7vals/assignment/pull/1","diff_url":"https://github.com/mujtaba7vals/assignment/pull/1.diff","patch_url":"https://github.com/mujtaba7vals/assignment/pull/1.patch","issue_url":"https://api.github.com/repos/mujtaba7vals/assignment/issues/1","number":1,"state":"closed","locked":false,"title":"First","user":{"login":"mujtaba7vals","id":39899184,"node_id":"MDQ6VXNlcjM5ODk5MTg0","avatar_url":"https://avatars0.githubusercontent.com/u/39899184?v=4","gravatar_id":"","url":"https://api.github.com/users/mujtaba7vals","html_url":"https://github.com/mujtaba7vals","followers_url":"https://api.github.com/users/mujtaba7vals/followers","following_url":"https://api.github.com/users/mujtaba7vals/following{/other_user}","gists_url":"https://api.github.com/users/mujtaba7vals/gists{/gist_id}","starred_url":"https://api.github.com/users/mujtaba7vals/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mujtaba7vals/subscriptions","organizations_url":"https://api.github.com/users/mujtaba7vals/orgs","repos_url":"https://api.github.com/users/mujtaba7vals/repos","events_url":"https://api.github.com/users/mujtaba7vals/events{/privacy}","received_events_url":"https://api.github.com/users/mujtaba7vals/received_events","type":"User","site_admin":false},"body":"assignment edited","created_at":"2018-06-13T06:39:46Z","updated_at":"2018-06-14T05:47:56Z","closed_at":"2018-06-13T10:19:42Z","merged_at":null,"merge_commit_sha":"d386af1c2503295c23ad82fcbb9a237876c10970","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/mujtaba7vals/assignment/pulls/1/commits","review_comments_url":"https://api.github.com/repos/mujtaba7vals/assignment/pulls/1/comments","review_comment_url":"https://api.github.com/repos/mujtaba7vals/assignment/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mujtaba7vals/assignment/issues/1/comments","statuses_url":"https://api.github.com/repos/mujtaba7vals/assignment/statuses/1e2da9bf3ac405628c5fb5eae0f8a2f80df9f474","head":{"label":"mujtaba7vals:first","ref":"first","sha":"1e2da9bf3ac405628c5fb5eae0f8a2f80df9f474","user":{"login":"mujtaba7vals","id":39899184,"node_id":"MDQ6VXNlcjM5ODk5MTg0","avatar_url":"https://avatars0.githubusercontent.com/u/39899184?v=4","gravatar_id":"","url":"https://api.github.com/users/mujtaba7vals","html_url":"https://github.com/mujtaba7vals","followers_url":"https://api.github.com/users/mujtaba7vals/followers","following_url":"https://api.github.com/users/mujtaba7vals/following{/other_user}","gists_url":"https://api.github.com/users/mujtaba7vals/gists{/gist_id}","starred_url":"https://api.github.com/users/mujtaba7vals/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mujtaba7vals/subscriptions","organizations_url":"https://api.github.com/users/mujtaba7vals/orgs","repos_url":"https://api.github.com/users/mujtaba7vals/repos","events_url":"https://api.github.com/users/mujtaba7vals/events{/privacy}","received_events_url":"https://api.github.com/users/mujtaba7vals/received_events","type":"User","site_admin":false},"repo":{"id":137166012,"node_id":"MDEwOlJlcG9zaXRvcnkxMzcxNjYwMTI=","name":"assignment","full_name":"mujtaba7vals/assignment","owner":{"login":"mujtaba7vals","id":39899184,"node_id":"MDQ6VXNlcjM5ODk5MTg0","avatar_url":"https://avatars0.githubusercontent.com/u/39899184?v=4","gravatar_id":"","url":"https://api.github.com/users/mujtaba7vals","html_url":"https://github.com/mujtaba7vals","followers_url":"https://api.github.com/users/mujtaba7vals/followers","following_url":"https://api.github.com/users/mujtaba7vals/following{/other_user}","gists_url":"https://api.github.com/users/mujtaba7vals/gists{/gist_id}","starred_url":"https://api.github.com/users/mujtaba7vals/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mujtaba7vals/subscriptions","organizations_url":"https://api.github.com/users/mujtaba7vals/orgs","repos_url":"https://api.github.com/users/mujtaba7vals/repos","events_url":"https://api.github.com/users/mujtaba7vals/events{/privacy}","received_events_url":"https://api.github.com/users/mujtaba7vals/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mujtaba7vals/assignment","description":null,"fork":false,"url":"https://api.github.com/repos/mujtaba7vals/assignment","forks_url":"https://api.github.com/repos/mujtaba7vals/assignment/forks","keys_url":"https://api.github.com/repos/mujtaba7vals/assignment/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mujtaba7vals/assignment/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mujtaba7vals/assignment/teams","hooks_url":"https://api.github.com/repos/mujtaba7vals/assignment/hooks","issue_events_url":"https://api.github.com/repos/mujtaba7vals/assignment/issues/events{/number}","events_url":"https://api.github.com/repos/mujtaba7vals/assignment/events","assignees_url":"https://api.github.com/repos/mujtaba7vals/assignment/assignees{/user}","branches_url":"https://api.github.com/repos/mujtaba7vals/assignment/branches{/branch}","tags_url":"https://api.github.com/repos/mujtaba7vals/assignment/tags","blobs_url":"https://api.github.com/repos/mujtaba7vals/assignment/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mujtaba7vals/assignment/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mujtaba7vals/assignment/git/refs{/sha}","trees_url":"https://api.github.com/repos/mujtaba7vals/assignment/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mujtaba7vals/assignment/statuses/{sha}","languages_url":"https://api.github.com/repos/mujtaba7vals/assignment/languages","stargazers_url":"https://api.github.com/repos/mujtaba7vals/assignment/stargazers","contributors_url":"https://api.github.com/repos/mujtaba7vals/assignment/contributors","subscribers_url":"https://api.github.com/repos/mujtaba7vals/assignment/subscribers","subscription_url":"https://api.github.com/repos/mujtaba7vals/assignment/subscription","commits_url":"https://api.github.com/repos/mujtaba7vals/assignment/commits{/sha}","git_commits_url":"https://api.github.com/repos/mujtaba7vals/assignment/git/commits{/sha}","comments_url":"https://api.github.com/repos/mujtaba7vals/assignment/comments{/number}","issue_comment_url":"https://api.github.com/repos/mujtaba7vals/assignment/issues/comments{/number}","contents_url":"https://api.github.com/repos/mujtaba7vals/assignment/contents/{+path}","compare_url":"https://api.github.com/repos/mujtaba7vals/assignment/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mujtaba7vals/assignment/merges","archive_url":"https://api.github.com/repos/mujtaba7vals/assignment/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mujtaba7vals/assignment/downloads","issues_url":"https://api.github.com/repos/mujtaba7vals/assignment/issues{/number}","pulls_url":"https://api.github.com/repos/mujtaba7vals/assignment/pulls{/number}","milestones_url":"https://api.github.com/repos/mujtaba7vals/assignment/milestones{/number}","notifications_url":"https://api.github.com/repos/mujtaba7vals/assignment/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mujtaba7vals/assignment/labels{/name}","releases_url":"https://api.github.com/repos/mujtaba7vals/assignment/releases{/id}","deployments_url":"https://api.github.com/repos/mujtaba7vals/assignment/deployments","created_at":"2018-06-13T05:21:17Z","updated_at":"2018-06-13T08:28:47Z","pushed_at":"2018-06-14T05:26:52Z","git_url":"git://github.com/mujtaba7vals/assignment.git","ssh_url":"git@github.com:mujtaba7vals/assignment.git","clone_url":"https://github.com/mujtaba7vals/assignment.git","svn_url":"https://github.com/mujtaba7vals/assignment","homepage":null,"size":26,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"mujtaba7vals:master","ref":"master","sha":"860cceb13202459136758251d04bcbe484452220","user":{"login":"mujtaba7vals","id":39899184,"node_id":"MDQ6VXNlcjM5ODk5MTg0","avatar_url":"https://avatars0.githubusercontent.com/u/39899184?v=4","gravatar_id":"","url":"https://api.github.com/users/mujtaba7vals","html_url":"https://github.com/mujtaba7vals","followers_url":"https://api.github.com/users/mujtaba7vals/followers","following_url":"https://api.github.com/users/mujtaba7vals/following{/other_user}","gists_url":"https://api.github.com/users/mujtaba7vals/gists{/gist_id}","starred_url":"https://api.github.com/users/mujtaba7vals/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mujtaba7vals/subscriptions","organizations_url":"https://api.github.com/users/mujtaba7vals/orgs","repos_url":"https://api.github.com/users/mujtaba7vals/repos","events_url":"https://api.github.com/users/mujtaba7vals/events{/privacy}","received_events_url":"https://api.github.com/users/mujtaba7vals/received_events","type":"User","site_admin":false},"repo":{"id":137166012,"node_id":"MDEwOlJlcG9zaXRvcnkxMzcxNjYwMTI=","name":"assignment","full_name":"mujtaba7vals/assignment","owner":{"login":"mujtaba7vals","id":39899184,"node_id":"MDQ6VXNlcjM5ODk5MTg0","avatar_url":"https://avatars0.githubusercontent.com/u/39899184?v=4","gravatar_id":"","url":"https://api.github.com/users/mujtaba7vals","html_url":"https://github.com/mujtaba7vals","followers_url":"https://api.github.com/users/mujtaba7vals/followers","following_url":"https://api.github.com/users/mujtaba7vals/following{/other_user}","gists_url":"https://api.github.com/users/mujtaba7vals/gists{/gist_id}","starred_url":"https://api.github.com/users/mujtaba7vals/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mujtaba7vals/subscriptions","organizations_url":"https://api.github.com/users/mujtaba7vals/orgs","repos_url":"https://api.github.com/users/mujtaba7vals/repos","events_url":"https://api.github.com/users/mujtaba7vals/events{/privacy}","received_events_url":"https://api.github.com/users/mujtaba7vals/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mujtaba7vals/assignment","description":null,"fork":false,"url":"https://api.github.com/repos/mujtaba7vals/assignment","forks_url":"https://api.github.com/repos/mujtaba7vals/assignment/forks","keys_url":"https://api.github.com/repos/mujtaba7vals/assignment/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mujtaba7vals/assignment/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mujtaba7vals/assignment/teams","hooks_url":"https://api.github.com/repos/mujtaba7vals/assignment/hooks","issue_events_url":"https://api.github.com/repos/mujtaba7vals/assignment/issues/events{/number}","events_url":"https://api.github.com/repos/mujtaba7vals/assignment/events","assignees_url":"https://api.github.com/repos/mujtaba7vals/assignment/assignees{/user}","branches_url":"https://api.github.com/repos/mujtaba7vals/assignment/branches{/branch}","tags_url":"https://api.github.com/repos/mujtaba7vals/assignment/tags","blobs_url":"https://api.github.com/repos/mujtaba7vals/assignment/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mujtaba7vals/assignment/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mujtaba7vals/assignment/git/refs{/sha}","trees_url":"https://api.github.com/repos/mujtaba7vals/assignment/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mujtaba7vals/assignment/statuses/{sha}","languages_url":"https://api.github.com/repos/mujtaba7vals/assignment/languages","stargazers_url":"https://api.github.com/repos/mujtaba7vals/assignment/stargazers","contributors_url":"https://api.github.com/repos/mujtaba7vals/assignment/contributors","subscribers_url":"https://api.github.com/repos/mujtaba7vals/assignment/subscribers","subscription_url":"https://api.github.com/repos/mujtaba7vals/assignment/subscription","commits_url":"https://api.github.com/repos/mujtaba7vals/assignment/commits{/sha}","git_commits_url":"https://api.github.com/repos/mujtaba7vals/assignment/git/commits{/sha}","comments_url":"https://api.github.com/repos/mujtaba7vals/assignment/comments{/number}","issue_comment_url":"https://api.github.com/repos/mujtaba7vals/assignment/issues/comments{/number}","contents_url":"https://api.github.com/repos/mujtaba7vals/assignment/contents/{+path}","compare_url":"https://api.github.com/repos/mujtaba7vals/assignment/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mujtaba7vals/assignment/merges","archive_url":"https://api.github.com/repos/mujtaba7vals/assignment/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mujtaba7vals/assignment/downloads","issues_url":"https://api.github.com/repos/mujtaba7vals/assignment/issues{/number}","pulls_url":"https://api.github.com/repos/mujtaba7vals/assignment/pulls{/number}","milestones_url":"https://api.github.com/repos/mujtaba7vals/assignment/milestones{/number}","notifications_url":"https://api.github.com/repos/mujtaba7vals/assignment/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mujtaba7vals/assignment/labels{/name}","releases_url":"https://api.github.com/repos/mujtaba7vals/assignment/releases{/id}","deployments_url":"https://api.github.com/repos/mujtaba7vals/assignment/deployments","created_at":"2018-06-13T05:21:17Z","updated_at":"2018-06-13T08:28:47Z","pushed_at":"2018-06-14T05:26:52Z","git_url":"git://github.com/mujtaba7vals/assignment.git","ssh_url":"git@github.com:mujtaba7vals/assignment.git","clone_url":"https://github.com/mujtaba7vals/assignment.git","svn_url":"https://github.com/mujtaba7vals/assignment","homepage":null,"size":26,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mujtaba7vals/assignment/pulls/1"},"html":{"href":"https://github.com/mujtaba7vals/assignment/pull/1"},"issue":{"href":"https://api.github.com/repos/mujtaba7vals/assignment/issues/1"},"comments":{"href":"https://api.github.com/repos/mujtaba7vals/assignment/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/mujtaba7vals/assignment/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/mujtaba7vals/assignment/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mujtaba7vals/assignment/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/mujtaba7vals/assignment/statuses/1e2da9bf3ac405628c5fb5eae0f8a2f80df9f474"}},"author_association":"OWNER"}}
{"actor":{"display_login":"HassanAkbar"}}