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.



138
139
140
# File 'lib/linguist/heuristics.rb', line 138

def initialize(pats)
  @pats = pats
end

Instance Method Details

#match(input) ⇒ Object



142
143
144
# File 'lib/linguist/heuristics.rb', line 142

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