vendor/bundle/ruby/2.3.0/gems/public_suffix-1.5.3/lib/public_suffix/list.rb
# Selects all the rules matching given domain.
#
# Will use +@indexes+ to try only the rules that share the same first label,
# that will speed up things when using +List.find('foo')+ a lot.
#
# @param  [String, #to_s] domain The domain name.
#
# @return [Array<PublicSuffix::Rule::*>]
Selects all the rules matching given domain.
Will use +@indexes+ to try only the rules that share the same first label,
that will speed up things when using +List.find('foo')+ a lot.
Selects all the rules matching given domain . Will use + @indexes + to try only the rules that share the same first label that will speed up things when using + List . find ( ' foo ' ) + a lot .
def select(domain)
      return [] if domain.to_s =~ /\A\s*\z/
      return [] if domain.include?("://")
      indices = (@indexes[Domain.domain_to_labels(domain).first] || [])
      @rules.values_at(*indices).select { |rule| rule.match?(domain) }
    end
def select ( domain ) return [ ] if domain . to_s =~ / \A \s * \z / return [ ] if domain . include? ( "://" ) indices = ( @indexes [ Domain . domain_to_labels ( domain ) . first ] || [ ] ) @rules . values_at ( * indices ) . select { | rule | rule . match? ( domain ) } end
Selects all the rules matching given domain.
Selects all the rules matching given domain .
# raise DomainInvalid, "Blank domain" # raise DomainInvalid, "`#{domain}' is not expected to contain a scheme"
None
Array<PublicSuffix::Rule::*>
domain
<not_specific>
<not_specific>
domain The domain name.
domain The domain name .