<commit_before><commit_msg>Sample showing simple meta-programming techniques.<commit_after>class Todo
  @todo_list = []

  def self.list
    @todo_list
  end

  def self.edit(&block)
    class_eval(&block)
  end

  def self.method_missing(task_name)
    if task_name[-1..-1] == "!" and @todo_list.include? task_name[0...-1].to_sym
      @todo_list.delete task_name[0...-1]
    else
      @todo_list << task_name unless @todo_list.include? task_name
    end
  end
end

Todo.walk_dog
Todo.take_out_trash

Todo.edit do
  take_out_trash!
  buy_groceries
end

p Todo.list
{'fraction_non_alphanumeric': 0.11307420494699646, 'fraction_numerical': 0.01060070671378092, 'mean_word_length': 3.4296875, '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': '7431774', 'n_tokens_mistral': 225, 'n_tokens_neox': 219, 'n_words': 42}