Class: Linguist::And

Inherits:
Object
  • Object
show all
Defined in:
lib/linguist/heuristics.rb

Instance Method Summary collapse

Constructor Details

#initialize(pats) ⇒ And

Returns a new instance of And.



119
120
121
# File 'lib/linguist/heuristics.rb', line 119

def initialize(pats)
  @pats = pats
end

Instance Method Details

#match(input) ⇒ Object



123
124
125
# File 'lib/linguist/heuristics.rb', line 123

def match(input)
  return !@pats.any? { |pat| !pat.match(input) }
end