Class: Treebis::DirAsHash::Blacklist::StringMatcher

Inherits:
MatcherWithTail show all
Defined in:
lib/treebis.rb

Instance Method Summary collapse

Methods inherited from MatcherWithTail

#include?, #submatcher, #tail=

Methods included from MatcherFactory

#create_matcher

Constructor Details

#initialize(str, tail = nil) ⇒ StringMatcher

Returns a new instance of StringMatcher.



306
307
308
309
# File 'lib/treebis.rb', line 306

def initialize str, tail=nil
  @head = str
  self.tail = tail
end

Instance Method Details

#head_include?(str) ⇒ Boolean

Returns:

  • (Boolean)


310
311
312
# File 'lib/treebis.rb', line 310

def head_include? str
  @head == str
end