<commit_before>module HasAchievements #:nodoc:
  
  def self.included(base)
    base.extend(HasManyMacro)
  end
  
  
  module HasManyMacro
    def has_achievements(options={})
      include InstanceMethods
      extend ClassMethods
    end
  end # HasManyMacro
  
  
  module ClassMethods
    # Get all achievements for class
    def achievements
      read_inheritable_attribute(:achievements).keys.collect { |achievement| achievement.to_sym }
    end
    
    # Add achievement to class's achievements hash
    def achievement(title, options={})
      hook = {} # Just a test for now
      write_inheritable_hash(:achievements, title => hook)
    end
  end # ClassMethods
  
  
  module InstanceMethods
    
  end # InstanceMethods
  
end # HasAchievements<commit_msg>achievements class hash should still be created even when no achievements are added yet<commit_after>module HasAchievements #:nodoc:
  
  def self.included(base)
    base.extend(HasManyMacro)
  end
  
  
  module HasManyMacro
    def has_achievements(options={})
      include InstanceMethods
      extend ClassMethods
    end
  end # HasManyMacro
  
  
  module ClassMethods
    # Get all achievements for class
    def achievements
      read_inheritable_attribute(:achievements) || write_inheritable_attribute(:achievements, {})
    end
    
    # Add achievement to class's achievements hash
    def achievement(title, options={})
      hook = {} # Just a test for now
      write_inheritable_hash(:achievements, title => hook)
    end
  end # ClassMethods
  
  
  module InstanceMethods
    
  end # InstanceMethods
  
end # HasAchievements
{'fraction_non_alphanumeric': 0.0625, 'fraction_numerical': 0.0, 'mean_word_length': 3.146153846153846, 'pattern_counts': {'":': 0, '<': 3, '<?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': '5795887', 'n_tokens_mistral': 470, 'n_tokens_neox': 472, 'n_words': 127}