<commit_before>module MoneyConverter

  class Money

    attr_accessor :amount, :currency

    def initialize(amount, currency)
      @amount = amount
      @currency = currency
    end

    def inspect
      "#{'%.2f' % amount} #{currency}"
    end

    def convert_to(currency)
      if currency == self.currency
        self.dup
      else
        Money.new(converted_amount_for(currency), currency)
      end
    end

    private

    def converted_amount_for(currency)
      rate = MoneyConverter.config.conversion_rates[self.currency][currency]
      (self.amount * rate).round(2)
    end

  end

end<commit_msg>Removed unnecessary selfs and use format instead of String#% for clarity.<commit_after>module MoneyConverter

  class Money

    attr_accessor :amount, :currency

    def initialize(amount, currency)
      @amount = amount
      @currency = currency
    end

    def inspect
      "#{format('%.2f', amount)} #{currency}"
    end

    def convert_to(currency)
      if currency == self.currency
        dup
      else
        Money.new(converted_amount_for(currency), currency)
      end
    end

    private

    def converted_amount_for(currency)
      rate = MoneyConverter.config.conversion_rates[self.currency][currency]
      (amount * rate).round(2)
    end

  end

end
{'fraction_non_alphanumeric': 0.08739365815931942, 'fraction_numerical': 0.0030935808197989174, 'mean_word_length': 2.6450704225352113, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '638141', 'n_tokens_mistral': 380, 'n_tokens_neox': 361, 'n_words': 93}