<commit_before>module PaymentProcessor
  module Clients
    module Braintree

      class MerchantAccountSelector
        MERCHANT_ACCOUNTS = Settings.braintree.merchants.to_hash.dup.freeze

        def self.for_currency(currency)
          new(currency).merchant_account_id
        end

        def initialize(currency)
          @currency = currency
        end

        def merchant_account_id
          raise_error if @currency.nil?
          id = MERCHANT_ACCOUNTS[@currency.upcase.to_sym]
          raise_error unless id
          id
        end

        def raise_error
          raise PaymentProcessor::Exceptions::InvalidCurrency, "No merchant account is associated with this currency: #{@currency}"
        end
      end
    end
  end
end
<commit_msg>use blank?, not nil?<commit_after>module PaymentProcessor
  module Clients
    module Braintree

      class MerchantAccountSelector
        MERCHANT_ACCOUNTS = Settings.braintree.merchants.to_hash.dup.freeze

        def self.for_currency(currency)
          new(currency).merchant_account_id
        end

        def initialize(currency)
          @currency = currency
        end

        def merchant_account_id
          raise_error if @currency.blank?
          id = MERCHANT_ACCOUNTS[@currency.upcase.to_sym]
          raise_error unless id
          id
        end

        def raise_error
          raise PaymentProcessor::Exceptions::InvalidCurrency, "No merchant account is associated with this currency: #{@currency}"
        end
      end
    end
  end
end

{'fraction_non_alphanumeric': 0.05421293272370999, 'fraction_numerical': 0.0, 'mean_word_length': 2.2595744680851064, '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': '2144015', 'n_tokens_mistral': 414, 'n_tokens_neox': 401, 'n_words': 101}