diff --git a/ruby/item.rb b/ruby/item.rb new file mode 100644 index 00000000..2ad08960 --- /dev/null +++ b/ruby/item.rb @@ -0,0 +1,13 @@ +class Item + attr_accessor :name, :sell_in, :quality + + def initialize(name, sell_in, quality) + @name = name # Name of the item + @sell_in = sell_in # Number of days to sell the item + @quality = quality # Represents how valuable the item is + end + + def to_s() + "#{@name}, #{@sell_in}, #{@quality}" # Representing the item's details as a string + end +end