<commit_before>module YARD::CodeObjects
  class NamespaceObject < Base
    attr_reader :children, :cvars, :meths, :constants, :mixins
    
    def initialize(namespace, name, *args, &block)
      @children = []
      @mixins = []
      super
    end
    
    def child(name)
      children.find {|o| o.name == name.to_sym }
    end
    
    def meths(opts = {})
      opts = SymbolHash[
        :visibility => [:public, :private, :protected],
        :scope => [:class, :instance],
        :mixins => true
      ].update(opts)
      
      opts[:visibility] = [opts[:visibility]].flatten
      opts[:scope] = [opts[:scope]].flatten

      ourmeths = children.select do |o| 
        o.is_a?(MethodObject) && 
          opts[:visibility].include?(o.visibility) &&
          opts[:scope].include?(o.scope)
      end
      
      if opts[:mixins]
        methnames = ourmeths.map {|o| o.name }
        mixinmeths = mixins.inject([]) do |list, mixin|
          next if mixin.is_a?(Proxy)
          list += mixin.meths(opts).reject do |o| 
            methnames.include? o.name 
          end
        end<commit_msg>Use CodeObjectList again for @children and @mixins (specs work again)<commit_after>module YARD::CodeObjects
  class NamespaceObject < Base
    attr_reader :children, :cvars, :meths, :constants, :mixins
    
    def initialize(namespace, name, *args, &block)
      @children = CodeObjectList.new(self)
      @mixins = CodeObjectList.new(self)
      super
    end
    
    def child(name)
      children.find {|o| o.name == name.to_sym }
    end
    
    def meths(opts = {})
      opts = SymbolHash[
        :visibility => [:public, :private, :protected],
        :scope => [:class, :instance],
        :mixins => true
      ].update(opts)
      
      opts[:visibility] = [opts[:visibility]].flatten
      opts[:scope] = [opts[:scope]].flatten

      ourmeths = children.select do |o| 
        o.is_a?(MethodObject) && 
          opts[:visibility].include?(o.visibility) &&
          opts[:scope].include?(o.scope)
      end
      
      if opts[:mixins]
        methnames = ourmeths.map {|o| o.name }
        mixinmeths = mixins.inject([]) do |list, mixin|
          next if mixin.is_a?(Proxy)
          list += mixin.meths(opts).reject do |o| 
            methnames.include? o.name 
          end
        end
{'fraction_non_alphanumeric': 0.13793103448275862, 'fraction_numerical': 0.0, 'mean_word_length': 2.170765027322404, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, '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': '1548151', 'n_tokens_mistral': 760, 'n_tokens_neox': 740, 'n_words': 160}