<commit_before>require 'axe/api/value_object'

module Axe
  module API
    class Results < ValueObject
      require 'axe/api/results/rule'

      values do
        attribute :url, ::String
        attribute :timestamp
        attribute :passes, ::Array[Rule]
        attribute :violations, ::Array[Rule]
      end

      def failure_message
        [ violation_count_message ].concat(violations_failure_messages).join("\n")
      end

      private

      def violation_count_message
        "Found #{violations.count} accessibility #{violations.count == 1 ? 'violation' : 'violations'}"
      end

      def violations_failure_messages
        violations.each_with_index.map(&:failure_message)
      end
    end
  end
end<commit_msg>Give some separation from rspec scenario description<commit_after>require 'axe/api/value_object'

module Axe
  module API
    class Results < ValueObject
      require 'axe/api/results/rule'

      values do
        attribute :url, ::String
        attribute :timestamp
        attribute :passes, ::Array[Rule]
        attribute :violations, ::Array[Rule]
      end

      def failure_message
        [ violation_count_message ].concat(violations_failure_messages).join("\n")
      end

      private

      def violation_count_message
        "Found #{violations.count} accessibility #{violations.count == 1 ? 'violation' : 'violations'}:\n"
      end

      def violations_failure_messages
        violations.each_with_index.map(&:failure_message)
      end
    end
  end
end
{'fraction_non_alphanumeric': 0.0873015873015873, 'fraction_numerical': 0.0013227513227513227, 'mean_word_length': 2.745049504950495, 'pattern_counts': {'":': 0, '<': 5, '<?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': '476296', 'n_tokens_mistral': 445, 'n_tokens_neox': 417, 'n_words': 101}