Skip to content

Conversation

@the38th
Copy link
Owner

@the38th the38th commented Dec 7, 2020

No description provided.

def film_multicountry?(film)
return false if film['country'].nil?

film['country'].include?(',')

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

запятая конечно на тоненького, по хорошему должно быть упоминание про две страны и больше

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

я что-то не могу придумать как проверить количество стран без запятой, там же просто строка возвращается при обращении, а не коллекция у которой можно узнать размер
можно конечно засплитить строку в массив, по запятой, но это разве не то же самое по сути?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

не тоже самое, include просто запятую проверяет (как будто нам только запятая важно), а сплит хотя бы семантику количества добавит


def rating(array)
multicountry_rated_films = []
array.map { |film| multicountry_rated_films << film if film_rated?(film) && film_multicountry?(film) }

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

используешь мап и мутации, мап новый массив возвращает. И т.к. у тебя здесь по сути фильтрация, то функцию фильтрации и нужно использовать

Copy link
Owner Author

@the38th the38th Dec 9, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

функция фильтрации это select? просто в задании сказано использовать map и reduce
или ты имел ввиду что-то такое?
multicountry_rated_films = array.filter_map { |film| film if film_rated?(film) && film_multicountry?(film) }

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

селект или фильтр мап пойдет

0
def chars_count(films, threshold)
top_rated_films = []
films.map { |film| top_rated_films << film if raiting_of_film(film) > threshold }
Copy link

@greybutton greybutton Dec 7, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

здесь тоже самое про фильтрацию и мутацию

0
def chars_count(films, threshold)
top_rated_films = []
films.map { |film| top_rated_films << film if raiting_of_film(film) > threshold }

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

и еще здесь абстрация raiting_of_film протекла, она должна полностью и ответить подходит фильм для посчета или нет

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

а когда переделаю новый PR делать или сделать новый коммит и написать тут об этом?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

в эту же ветку пуш

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants