<commit_before>require 'csv'
require './lib/tax_registry'

class Good
  def self.parse_all str
    data = CSV.parse(str, :converters => :numeric)
    data.shift
    data.map! { |row|
      row.each { |el| el.strip! if el.is_a?(String) }
      Good.new *row
    }
  end

  attr_reader :quantity, :name, :price

  def initialize quantity, name, price
    @quantity, @name, @price = quantity, name, price
  end

  def tax
    (price * TaxRegistry.tax_for_good(name)).round(2)
  end

  def total
    price
  end

  def to_s
    [quantity, name, price].map! { |el| el.to_s }.join(", ")
  end
end<commit_msg>+ Music CDs are taxed properly.<commit_after>require 'csv'
require './lib/tax_registry'

class Good
  def self.parse_all str
    data = CSV.parse(str, :converters => :numeric)
    data.shift
    data.map! { |row|
      row.each { |el| el.strip! if el.is_a?(String) }
      Good.new *row
    }
  end

  attr_reader :quantity, :name, :price

  def initialize quantity, name, price
    @quantity, @name, @price = quantity, name, price
  end

  def tax
    (price * TaxRegistry.tax_for_good(name)).round(2)
  end

  def total
    (price + tax).round(2)
  end

  def to_s
    [quantity, name, total].map! { |el| el.to_s }.join(", ")
  end
end
{'fraction_non_alphanumeric': 0.13720742534301855, 'fraction_numerical': 0.002421307506053269, 'mean_word_length': 2.8509316770186337, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1485885', 'n_tokens_mistral': 468, 'n_tokens_neox': 451, 'n_words': 123}