<commit_before>require 'multi_json'
require 'forwardable'

class Message
  extend Forwardable

  def initialize(metadata, payload)
    @metadata = metadata
    @payload  = payload
    @body     = MultiJson.load(payload, symbolize_keys: true)
  end

  def_delegator :@body, :[]
  def_delegators :@metadata, :routing_key, :timestamp, :exchange

  attr_reader :body

  def to_s
    "#<Message #{body.map { |k,v| "#{k}: #{v.inspect}" }.join(', ')}>"
  end
end
<commit_msg>Add message_id attr to Message<commit_after>require 'multi_json'
require 'forwardable'

class Message
  extend Forwardable

  def initialize(metadata, payload)
    @metadata = metadata
    @payload  = payload
    @body     = MultiJson.load(payload, symbolize_keys: true)
  end

  def_delegator :@body, :[]
  def_delegators :@metadata, :message_id, :routing_key, :timestamp, :exchange

  attr_reader :body

  def to_s
    "#<Message #{body.map { |k,v| "#{k}: #{v.inspect}" }.join(', ')}>"
  end
end

{'fraction_non_alphanumeric': 0.13871635610766045, 'fraction_numerical': 0.0, 'mean_word_length': 4.1436170212765955, 'pattern_counts': {'":': 0, '<': 5, '<?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': '7207930', 'n_tokens_mistral': 340, 'n_tokens_neox': 335, 'n_words': 83}