{"action":"created","comment":{"url":"https://api.github.com/repos/daftcode/ror4beginners2018/pulls/comments/233470128","pull_request_review_id":174889319,"id":233470128,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzMzQ3MDEyOA==","diff_hunk":"@@ -1,12 +1,89 @@\n-class Warrior\n-  def initialize(name:, level:)\n-  end\n+class Character\n+\tattr_reader :name\n+\tattr_accessor :level\n \n-  def strength\n-  end\n+\tdef initialize(name, level) \n+\t\t@name = (name.is_a? String) ? name : \"NoName Hero\"\n+\t\t@level = ((level.is_a? Integer) && (level < 100)) ? level : 1\n+\tend\n+\n+\tdef card\n+\t\tp \"#{name} (lvl #{level})\"\n+\tend\n+\n+\tdef strength\n+  \t\tlevel + [*1..12].sample\n+  \tend\n+end\n+\n+class Warrior < Character\n+  \tdef initialize(name, level)\n+  \t\tsuper(name, level)\n+  \tend  \t\n+end\n+\n+class Monster < Character\n+\tdef initialize(name, level)\n+  \t\tsuper(name, level)\n+  \tend\n end\n \n class BattleArena\n-  def initialize(first_character, second_character)\n-  end\n+\tattr_accessor :first_character, :second_character\n+\n+\tdef initialize(first_character, second_character)\n+\t\t@first_character = first_character\n+\t\t@second_character = second_character\n+\tend\n+\n+\tdef battle!\n+\t\tdamage1 = first_character.strength\n+\t\tdamage2 = second_character.strength\n+\t\tp \"#{first_character.name} attacked #{second_character.name} with #{damage1} damage\"\n+\t\tp \"#{second_character.name} attacked #{first_character.name} with #{damage2}\"\n+\n+\t\tif first_character.level > second_character.level\n+\t\t\tupgrade1 = first_character.level + 1\n+\t\t\tupgrade2 = second_character.level + 1 + (first_character.level - second_character.level)\n+\t\telsif first_character.level < second_character.level\n+\t\t\tupgrade1 = first_character.level + 1 + (second_character.level - first_character.level)\n+\t\t\tupgrade2 = second_character.level + 1\n+\t\telse\n+\t\t\tupgrade1 = first_character.level + 1\n+\t\t\tupgrade2 = second_character.level + 1\n+\t\tend\n+\n+\t\tif damage1 > damage2\n+\t\t\tif first_character.is_a? Warrior\n+\t\t\t\tfirst_character.level = (upgrade1 <= 99 ? upgrade1 : 99)\n+\t\t\tend\t\t\t\n+\t\t\tp \"#{first_character.name} won!!\"\n+\t\t\tfirst_character.card\n+\t\t\tsecond_character.card\n+\t\telsif damage1 < damage2\n+\t\t\tif second_character.is_a? Warrior\n+\t\t\t\tsecond_character.level = (upgrade2 <= 99 ? upgrade2 : 99)\n+\t\t\tend\n+\t\t\tp \"#{second_character.name} won!!\"\n+\t\t\tfirst_character.card\n+\t\t\tsecond_character.card\n+\t\telse \n+\t\t\tp \"Incredible battle, but still unsolved! Try one more time.\"\n+\t\t\tfirst_character.card\n+\t\t\tsecond_character.card\n+\t\tend\n+\tend \n+\n end\n+\n+warrior1 = Warrior.new(\"Jackie Chan\", 10)\n+warrior2 = Warrior.new(\"Seba\", 1)","path":"zad2/warriors.rb","position":87,"original_position":87,"commit_id":"6771b5016b986c2a2a30913ef90f112a411a7247","original_commit_id":"6771b5016b986c2a2a30913ef90f112a411a7247","user":{"login":"ahawrylak","id":18199403,"node_id":"MDQ6VXNlcjE4MTk5NDAz","avatar_url":"https://avatars3.githubusercontent.com/u/18199403?v=4","gravatar_id":"","url":"https://api.github.com/users/ahawrylak","html_url":"https://github.com/ahawrylak","followers_url":"https://api.github.com/users/ahawrylak/followers","following_url":"https://api.github.com/users/ahawrylak/following{/other_user}","gists_url":"https://api.github.com/users/ahawrylak/gists{/gist_id}","starred_url":"https://api.github.com/users/ahawrylak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ahawrylak/subscriptions","organizations_url":"https://api.github.com/users/ahawrylak/orgs","repos_url":"https://api.github.com/users/ahawrylak/repos","events_url":"https://api.github.com/users/ahawrylak/events{/privacy}","received_events_url":"https://api.github.com/users/ahawrylak/received_events","type":"User","site_admin":false},"body":"seba poziom 1 😄 👍 \r\n![screen shot 2018-11-14 at 15 32 00](https://user-images.githubusercontent.com/18199403/48489084-80121180-e822-11e8-92b8-1094293d6368.png)\r\n","created_at":"2018-11-14T14:32:39Z","updated_at":"2018-11-14T14:40:57Z","html_url":"https://github.com/daftcode/ror4beginners2018/pull/109#discussion_r233470128","pull_request_url":"https://api.github.com/repos/daftcode/ror4beginners2018/pulls/109","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/daftcode/ror4beginners2018/pulls/comments/233470128"},"html":{"href":"https://github.com/daftcode/ror4beginners2018/pull/109#discussion_r233470128"},"pull_request":{"href":"https://api.github.com/repos/daftcode/ror4beginners2018/pulls/109"}}},"pull_request":{"url":"https://api.github.com/repos/daftcode/ror4beginners2018/pulls/109","id":230237844,"node_id":"MDExOlB1bGxSZXF1ZXN0MjMwMjM3ODQ0","html_url":"https://github.com/daftcode/ror4beginners2018/pull/109","diff_url":"https://github.com/daftcode/ror4beginners2018/pull/109.diff","patch_url":"https://github.com/daftcode/ror4beginners2018/pull/109.patch","issue_url":"https://api.github.com/repos/daftcode/ror4beginners2018/issues/109","number":109,"state":"open","locked":false,"title":"Add solution task2","user":{"login":"Kombajn27","id":31371701,"node_id":"MDQ6VXNlcjMxMzcxNzAx","avatar_url":"https://avatars2.githubusercontent.com/u/31371701?v=4","gravatar_id":"","url":"https://api.github.com/users/Kombajn27","html_url":"https://github.com/Kombajn27","followers_url":"https://api.github.com/users/Kombajn27/followers","following_url":"https://api.github.com/users/Kombajn27/following{/other_user}","gists_url":"https://api.github.com/users/Kombajn27/gists{/gist_id}","starred_url":"https://api.github.com/users/Kombajn27/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Kombajn27/subscriptions","organizations_url":"https://api.github.com/users/Kombajn27/orgs","repos_url":"https://api.github.com/users/Kombajn27/repos","events_url":"https://api.github.com/users/Kombajn27/events{/privacy}","received_events_url":"https://api.github.com/users/Kombajn27/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-11-12T19:07:07Z","updated_at":"2018-11-14T14:40:57Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a0d1bcfff3b97503267f5d5718e62caf513e19ad","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/daftcode/ror4beginners2018/pulls/109/commits","review_comments_url":"https://api.github.com/repos/daftcode/ror4beginners2018/pulls/109/comments","review_comment_url":"https://api.github.com/repos/daftcode/ror4beginners2018/pulls/comments{/number}","comments_url":"https://api.github.com/repos/daftcode/ror4beginners2018/issues/109/comments","statuses_url":"https://api.github.com/repos/daftcode/ror4beginners2018/statuses/6771b5016b986c2a2a30913ef90f112a411a7247","head":{"label":"Kombajn27:zad2","ref":"zad2","sha":"6771b5016b986c2a2a30913ef90f112a411a7247","user":{"login":"Kombajn27","id":31371701,"node_id":"MDQ6VXNlcjMxMzcxNzAx","avatar_url":"https://avatars2.githubusercontent.com/u/31371701?v=4","gravatar_id":"","url":"https://api.github.com/users/Kombajn27","html_url":"https://github.com/Kombajn27","followers_url":"https://api.github.com/users/Kombajn27/followers","following_url":"https://api.github.com/users/Kombajn27/following{/other_user}","gists_url":"https://api.github.com/users/Kombajn27/gists{/gist_id}","starred_url":"https://api.github.com/users/Kombajn27/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Kombajn27/subscriptions","organizations_url":"https://api.github.com/users/Kombajn27/orgs","repos_url":"https://api.github.com/users/Kombajn27/repos","events_url":"https://api.github.com/users/Kombajn27/events{/privacy}","received_events_url":"https://api.github.com/users/Kombajn27/received_events","type":"User","site_admin":false},"repo":{"id":156094115,"node_id":"MDEwOlJlcG9zaXRvcnkxNTYwOTQxMTU=","name":"ror4beginners2018","full_name":"Kombajn27/ror4beginners2018","private":false,"owner":{"login":"Kombajn27","id":31371701,"node_id":"MDQ6VXNlcjMxMzcxNzAx","avatar_url":"https://avatars2.githubusercontent.com/u/31371701?v=4","gravatar_id":"","url":"https://api.github.com/users/Kombajn27","html_url":"https://github.com/Kombajn27","followers_url":"https://api.github.com/users/Kombajn27/followers","following_url":"https://api.github.com/users/Kombajn27/following{/other_user}","gists_url":"https://api.github.com/users/Kombajn27/gists{/gist_id}","starred_url":"https://api.github.com/users/Kombajn27/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Kombajn27/subscriptions","organizations_url":"https://api.github.com/users/Kombajn27/orgs","repos_url":"https://api.github.com/users/Kombajn27/repos","events_url":"https://api.github.com/users/Kombajn27/events{/privacy}","received_events_url":"https://api.github.com/users/Kombajn27/received_events","type":"User","site_admin":false},"html_url":"https://github.com/Kombajn27/ror4beginners2018","description":null,"fork":true,"url":"https://api.github.com/repos/Kombajn27/ror4beginners2018","forks_url":"https://api.github.com/repos/Kombajn27/ror4beginners2018/forks","keys_url":"https://api.github.com/repos/Kombajn27/ror4beginners2018/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Kombajn27/ror4beginners2018/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Kombajn27/ror4beginners2018/teams","hooks_url":"https://api.github.com/repos/Kombajn27/ror4beginners2018/hooks","issue_events_url":"https://api.github.com/repos/Kombajn27/ror4beginners2018/issues/events{/number}","events_url":"https://api.github.com/repos/Kombajn27/ror4beginners2018/events","assignees_url":"https://api.github.com/repos/Kombajn27/ror4beginners2018/assignees{/user}","branches_url":"https://api.github.com/repos/Kombajn27/ror4beginners2018/branches{/branch}","tags_url":"https://api.github.com/repos/Kombajn27/ror4beginners2018/tags","blobs_url":"https://api.github.com/repos/Kombajn27/ror4beginners2018/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Kombajn27/ror4beginners2018/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Kombajn27/ror4beginners2018/git/refs{/sha}","trees_url":"https://api.github.com/repos/Kombajn27/ror4beginners2018/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Kombajn27/ror4beginners2018/statuses/{sha}","languages_url":"https://api.github.com/repos/Kombajn27/ror4beginners2018/languages","stargazers_url":"https://api.github.com/repos/Kombajn27/ror4beginners2018/stargazers","contributors_url":"https://api.github.com/repos/Kombajn27/ror4beginners2018/contributors","subscribers_url":"https://api.github.com/repos/Kombajn27/ror4beginners2018/subscribers","subscription_url":"https://api.github.com/repos/Kombajn27/ror4beginners2018/subscription","commits_url":"https://api.github.com/repos/Kombajn27/ror4beginners2018/commits{/sha}","git_commits_url":"https://api.github.com/repos/Kombajn27/ror4beginners2018/git/commits{/sha}","comments_url":"https://api.github.com/repos/Kombajn27/ror4beginners2018/comments{/number}","issue_comment_url":"https://api.github.com/repos/Kombajn27/ror4beginners2018/issues/comments{/number}","contents_url":"https://api.github.com/repos/Kombajn27/ror4beginners2018/contents/{+path}","compare_url":"https://api.github.com/repos/Kombajn27/ror4beginners2018/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Kombajn27/ror4beginners2018/merges","archive_url":"https://api.github.com/repos/Kombajn27/ror4beginners2018/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Kombajn27/ror4beginners2018/downloads","issues_url":"https://api.github.com/repos/Kombajn27/ror4beginners2018/issues{/number}","pulls_url":"https://api.github.com/repos/Kombajn27/ror4beginners2018/pulls{/number}","milestones_url":"https://api.github.com/repos/Kombajn27/ror4beginners2018/milestones{/number}","notifications_url":"https://api.github.com/repos/Kombajn27/ror4beginners2018/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Kombajn27/ror4beginners2018/labels{/name}","releases_url":"https://api.github.com/repos/Kombajn27/ror4beginners2018/releases{/id}","deployments_url":"https://api.github.com/repos/Kombajn27/ror4beginners2018/deployments","created_at":"2018-11-04T15:05:52Z","updated_at":"2018-11-04T15:05:54Z","pushed_at":"2018-11-12T19:05:22Z","git_url":"git://github.com/Kombajn27/ror4beginners2018.git","ssh_url":"git@github.com:Kombajn27/ror4beginners2018.git","clone_url":"https://github.com/Kombajn27/ror4beginners2018.git","svn_url":"https://github.com/Kombajn27/ror4beginners2018","homepage":null,"size":1088,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"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":"daftcode:master","ref":"master","sha":"8877dacd83fd5525dc5a78276560f23d25ef1604","user":{"login":"daftcode","id":10532199,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEwNTMyMTk5","avatar_url":"https://avatars2.githubusercontent.com/u/10532199?v=4","gravatar_id":"","url":"https://api.github.com/users/daftcode","html_url":"https://github.com/daftcode","followers_url":"https://api.github.com/users/daftcode/followers","following_url":"https://api.github.com/users/daftcode/following{/other_user}","gists_url":"https://api.github.com/users/daftcode/gists{/gist_id}","starred_url":"https://api.github.com/users/daftcode/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/daftcode/subscriptions","organizations_url":"https://api.github.com/users/daftcode/orgs","repos_url":"https://api.github.com/users/daftcode/repos","events_url":"https://api.github.com/users/daftcode/events{/privacy}","received_events_url":"https://api.github.com/users/daftcode/received_events","type":"Organization","site_admin":false},"repo":{"id":155549821,"node_id":"MDEwOlJlcG9zaXRvcnkxNTU1NDk4MjE=","name":"ror4beginners2018","full_name":"daftcode/ror4beginners2018","private":false,"owner":{"login":"daftcode","id":10532199,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEwNTMyMTk5","avatar_url":"https://avatars2.githubusercontent.com/u/10532199?v=4","gravatar_id":"","url":"https://api.github.com/users/daftcode","html_url":"https://github.com/daftcode","followers_url":"https://api.github.com/users/daftcode/followers","following_url":"https://api.github.com/users/daftcode/following{/other_user}","gists_url":"https://api.github.com/users/daftcode/gists{/gist_id}","starred_url":"https://api.github.com/users/daftcode/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/daftcode/subscriptions","organizations_url":"https://api.github.com/users/daftcode/orgs","repos_url":"https://api.github.com/users/daftcode/repos","events_url":"https://api.github.com/users/daftcode/events{/privacy}","received_events_url":"https://api.github.com/users/daftcode/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/daftcode/ror4beginners2018","description":null,"fork":false,"url":"https://api.github.com/repos/daftcode/ror4beginners2018","forks_url":"https://api.github.com/repos/daftcode/ror4beginners2018/forks","keys_url":"https://api.github.com/repos/daftcode/ror4beginners2018/keys{/key_id}","collaborators_url":"https://api.github.com/repos/daftcode/ror4beginners2018/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/daftcode/ror4beginners2018/teams","hooks_url":"https://api.github.com/repos/daftcode/ror4beginners2018/hooks","issue_events_url":"https://api.github.com/repos/daftcode/ror4beginners2018/issues/events{/number}","events_url":"https://api.github.com/repos/daftcode/ror4beginners2018/events","assignees_url":"https://api.github.com/repos/daftcode/ror4beginners2018/assignees{/user}","branches_url":"https://api.github.com/repos/daftcode/ror4beginners2018/branches{/branch}","tags_url":"https://api.github.com/repos/daftcode/ror4beginners2018/tags","blobs_url":"https://api.github.com/repos/daftcode/ror4beginners2018/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/daftcode/ror4beginners2018/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/daftcode/ror4beginners2018/git/refs{/sha}","trees_url":"https://api.github.com/repos/daftcode/ror4beginners2018/git/trees{/sha}","statuses_url":"https://api.github.com/repos/daftcode/ror4beginners2018/statuses/{sha}","languages_url":"https://api.github.com/repos/daftcode/ror4beginners2018/languages","stargazers_url":"https://api.github.com/repos/daftcode/ror4beginners2018/stargazers","contributors_url":"https://api.github.com/repos/daftcode/ror4beginners2018/contributors","subscribers_url":"https://api.github.com/repos/daftcode/ror4beginners2018/subscribers","subscription_url":"https://api.github.com/repos/daftcode/ror4beginners2018/subscription","commits_url":"https://api.github.com/repos/daftcode/ror4beginners2018/commits{/sha}","git_commits_url":"https://api.github.com/repos/daftcode/ror4beginners2018/git/commits{/sha}","comments_url":"https://api.github.com/repos/daftcode/ror4beginners2018/comments{/number}","issue_comment_url":"https://api.github.com/repos/daftcode/ror4beginners2018/issues/comments{/number}","contents_url":"https://api.github.com/repos/daftcode/ror4beginners2018/contents/{+path}","compare_url":"https://api.github.com/repos/daftcode/ror4beginners2018/compare/{base}...{head}","merges_url":"https://api.github.com/repos/daftcode/ror4beginners2018/merges","archive_url":"https://api.github.com/repos/daftcode/ror4beginners2018/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/daftcode/ror4beginners2018/downloads","issues_url":"https://api.github.com/repos/daftcode/ror4beginners2018/issues{/number}","pulls_url":"https://api.github.com/repos/daftcode/ror4beginners2018/pulls{/number}","milestones_url":"https://api.github.com/repos/daftcode/ror4beginners2018/milestones{/number}","notifications_url":"https://api.github.com/repos/daftcode/ror4beginners2018/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/daftcode/ror4beginners2018/labels{/name}","releases_url":"https://api.github.com/repos/daftcode/ror4beginners2018/releases{/id}","deployments_url":"https://api.github.com/repos/daftcode/ror4beginners2018/deployments","created_at":"2018-10-31T11:56:32Z","updated_at":"2018-11-12T07:25:36Z","pushed_at":"2018-11-14T12:08:14Z","git_url":"git://github.com/daftcode/ror4beginners2018.git","ssh_url":"git@github.com:daftcode/ror4beginners2018.git","clone_url":"https://github.com/daftcode/ror4beginners2018.git","svn_url":"https://github.com/daftcode/ror4beginners2018","homepage":null,"size":1086,"stargazers_count":9,"watchers_count":9,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":81,"mirror_url":null,"archived":false,"open_issues_count":58,"license":null,"forks":81,"open_issues":58,"watchers":9,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/daftcode/ror4beginners2018/pulls/109"},"html":{"href":"https://github.com/daftcode/ror4beginners2018/pull/109"},"issue":{"href":"https://api.github.com/repos/daftcode/ror4beginners2018/issues/109"},"comments":{"href":"https://api.github.com/repos/daftcode/ror4beginners2018/issues/109/comments"},"review_comments":{"href":"https://api.github.com/repos/daftcode/ror4beginners2018/pulls/109/comments"},"review_comment":{"href":"https://api.github.com/repos/daftcode/ror4beginners2018/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/daftcode/ror4beginners2018/pulls/109/commits"},"statuses":{"href":"https://api.github.com/repos/daftcode/ror4beginners2018/statuses/6771b5016b986c2a2a30913ef90f112a411a7247"}},"author_association":"NONE"}}
{"actor":{"display_login":"ahawrylak"}}