{"comment":{"url":"https://api.github.com/repos/beatrisia/thinknetica/comments/30822262","html_url":"https://github.com/beatrisia/thinknetica/commit/7038be3c727df99c80e95479d179ef35a901a20b#commitcomment-30822262","id":30822262,"node_id":"MDEzOkNvbW1pdENvbW1lbnQzMDgyMjI2Mg==","user":{"login":"max-underthesun","id":13752607,"node_id":"MDQ6VXNlcjEzNzUyNjA3","avatar_url":"https://avatars3.githubusercontent.com/u/13752607?v=4","gravatar_id":"","url":"https://api.github.com/users/max-underthesun","html_url":"https://github.com/max-underthesun","followers_url":"https://api.github.com/users/max-underthesun/followers","following_url":"https://api.github.com/users/max-underthesun/following{/other_user}","gists_url":"https://api.github.com/users/max-underthesun/gists{/gist_id}","starred_url":"https://api.github.com/users/max-underthesun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/max-underthesun/subscriptions","organizations_url":"https://api.github.com/users/max-underthesun/orgs","repos_url":"https://api.github.com/users/max-underthesun/repos","events_url":"https://api.github.com/users/max-underthesun/events{/privacy}","received_events_url":"https://api.github.com/users/max-underthesun/received_events","type":"User","site_admin":false},"position":53,"line":11,"path":"lesson2/lesson2_5.rb","commit_id":"7038be3c727df99c80e95479d179ef35a901a20b","created_at":"2018-10-09T03:48:19Z","updated_at":"2018-10-09T03:48:19Z","author_association":"NONE","body":"тут будет ошибка, при вычислении даты первого месяца\r\nя тебе про это писал, ты видимо не обратила внимания\r\nвот:\r\n```\r\n$ ruby lesson2_5.rb \r\nДень рождения\r\n1\r\nМесяц рождения\r\n1\r\nГод рождения\r\n1\r\nTraceback (most recent call last):\r\nlesson2_5.rb:11:in `<main>': undefined method `+' for nil:NilClass (NoMethodError)\r\n```\r\nпадает, потому что `inject` на пустом массиве возвращает `nil`, потом ты пытаешься к этому `nil` прибавить день\r\nнадо либо нил превратить в цифру:\r\n```ruby\r\ndays = months.take(month - 1).inject(:+).to_i + day\r\n```\r\nлибо не добавлять день в явном виде, а скормить его инжекту в качестве начального значения:\r\n```ruby\r\ndays = months.take(month - 1).inject(day, :+)\r\n```"}}
{"actor":{"display_login":"max-underthesun"}}