From e11bea8f43a9923105acb6f1369ca50241f0bf0d Mon Sep 17 00:00:00 2001 From: George Date: Thu, 21 Dec 2023 19:55:48 +0400 Subject: [PATCH] Fix linters --- app.rb | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/app.rb b/app.rb index e68cea5..c55fae5 100644 --- a/app.rb +++ b/app.rb @@ -7,6 +7,7 @@ require './classes/author' require './classes/movie' +# rubocop:disable Metrics/ClassLength class App def initialize @books = [] @@ -172,20 +173,22 @@ def add_game puts 'Game added successfully!' end + # rubocop:enable Metrics/ClassLength + private - # Modified code: Method to find or create an author based on full name - def find_or_create_author(full_name) - first_name, last_name = full_name.split - author = @authors.find { |a| a.first_name == first_name && a.last_name == last_name } + # Modified code: Method to find or create an author based on full name + def find_or_create_author(full_name) + first_name, last_name = full_name.split + author = @authors.find { |a| a.first_name == first_name && a.last_name == last_name } - unless author - author = Author.new(first_name: first_name, last_name: last_name) - @authors << author - end + unless author + author = Author.new(first_name: first_name, last_name: last_name) + @authors << author + end - author -end + author + end def choose_label(item) puts 'Label title:'