<commit_before>#requiring here doesn't feel right
require_relative '../helpers/fuzzy_time_helper'

class NotificationsPresenter
  include Sinatra::FuzzyTimeHelper

  def initialize(notifications)
    @notifications = transform(notifications)
  end
  
  def to_json
    @notifications.to_json
  end

  def transform(notifications)
    notifications.map { |notification|
      {
        id: notification.id,
        regarding: notification.regarding,
        read: notification.read,
        link: notification.link,
        from: notification.from,
        date: notification.at.to_time.to_i,
        humanReadableDate: ago(notification.at),
      }
    }
  end
end<commit_msg>use do … end instead of staches<commit_after>#requiring here doesn't feel right
require_relative '../helpers/fuzzy_time_helper'

class NotificationsPresenter
  include Sinatra::FuzzyTimeHelper

  def initialize(notifications)
    @notifications = transform(notifications)
  end

  def to_json
    @notifications.to_json
  end

  def transform(notifications)
    notifications.map do |notification|
      {
        id: notification.id,
        regarding: notification.regarding,
        read: notification.read,
        link: notification.link,
        from: notification.from,
        date: notification.at.to_time.to_i,
        humanReadableDate: ago(notification.at),
      }
    end
  end
end
{'fraction_non_alphanumeric': 0.07950401167031364, 'fraction_numerical': 0.0, 'mean_word_length': 3.1450151057401814, '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': '5704949', 'n_tokens_mistral': 399, 'n_tokens_neox': 391, 'n_words': 87}