Skip to content

Commit

Permalink
Fix linters
Browse files Browse the repository at this point in the history
  • Loading branch information
George7h committed Dec 21, 2023
1 parent 9c927c1 commit e11bea8
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions app.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
require './classes/author'
require './classes/movie'

# rubocop:disable Metrics/ClassLength
class App
def initialize
@books = []
Expand Down Expand Up @@ -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:'
Expand Down

0 comments on commit e11bea8

Please sign in to comment.