def select(name, ignore_private: false)
      name = name.to_s

      parts = name.split(DOT).reverse!
      index = 0
      query = parts[index]
      rules = []

      loop do
        match = @rules[query]
        rules << entry_to_rule(match, query) if !match.nil? && (ignore_private == false || match.private == false)

        index += 1
        break if index >= parts.size

        query = parts[index] + DOT + query
      end

      rules
    end
def select(name, ignore_private: false)
      name = name.to_s

      parts = name.split(DOT).reverse!
      index = 0
      query = parts[index]
      rules = []

      loop do
        match = @rules[query]
        rules << entry_to_rule(match, query) if !match.nil? && (ignore_private == false || match.private == false)

        index += 1
        break if index >= parts.size

        query = parts[index] + DOT + query
      end

      rules
    end
Selects all the rules matching given hostame.

 If `ignore_private` is set to true, the algorithm will skip the rules that are flagged as
 private domain. Note that the rules will still be part of the loop.
 If you frequently need to access lists ignoring the private domains,
 you should create a list that doesn't include these domains setting the
 `private_domains: false` option when calling {.parse}.

 Note that this method is currently private, as you should not rely on it. Instead,
 the public interface is {#find}. The current internal algorithm allows to return all
 matching rules, but different data structures may not be able to do it, and instead would
 return only the match. For this reason, you should rely on {#find}.

 @param  name [#to_s] the hostname
 @param  ignore_private [Boolean]
 @return [Array<PublicSuffix::Rule::*>]