<commit_before>module CardconnectSdk
  module SettlementStatus
    class Response
      include Attributable

      attr_reader :batches

      def initialize(batches=[])
        @batches = []
        batches.each do |batch|
          @batches << Batch.new(batch)
        end
      end

      def self.from_json(json)
        self.new(JSON.parse(json))
      end

    end
  end
end

# [
#   {
#     "txns": [
#       {
#         "setlstat": "N",
#         "retref": "179001161341"
#       },<commit_msg>Explain override for #from_json<commit_after>module CardconnectSdk
  module SettlementStatus
    class Response
      include Attributable

      attr_reader :batches

      def initialize(batches=[])
        @batches = []
        batches.each do |batch|
          @batches << Batch.new(batch)
        end
      end

      # Overridden because the json returns an array instead of
      # a typical hash, so deep_stringify_keys would fail.
      def self.from_json(json)
        self.new(JSON.parse(json))
      end

    end
  end
end

# [
#   {
#     "txns": [
#       {
#         "setlstat": "N",
#         "retref": "179001161341"
#       },
{'fraction_non_alphanumeric': 0.1054925893635571, 'fraction_numerical': 0.020924149956408022, 'mean_word_length': 1.9063291139240506, 'pattern_counts': {'":': 6, '<': 7, '<?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': '7480596', 'n_tokens_mistral': 392, 'n_tokens_neox': 365, 'n_words': 83}