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.



144
145
146
# File 'lib/linguist/heuristics.rb', line 144

def initialize(pats)
  @pats = pats
end

Instance Method Details

#match?(input) ⇒ Boolean

Returns:

  • (Boolean)


148
149
150
# File 'lib/linguist/heuristics.rb', line 148

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