Skip to content

Commit

Permalink
Update file
Browse files Browse the repository at this point in the history
  • Loading branch information
IvonneBenitesRodriguez committed Nov 30, 2023
1 parent 5db1d95 commit e41e9d1
Showing 1 changed file with 15 additions and 16 deletions.
31 changes: 15 additions & 16 deletions classes/genre.rb
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
class Genre
attr_reader :id, :name
attr_accessor :items

def initialize(id, name)
@id = id
@name = name
@items = []
end

def add_item(item)
return if @items.include?(item)

@items << item
item.genre = self
end
attr_reader :id, :name
attr_accessor :items

def initialize(id, name)
@id = id
@name = name
@items = []
end


def add_item(item)
return if @items.include?(item)

@items << item
item.genre = self
end
end

0 comments on commit e41e9d1

Please sign in to comment.