Class: Treebis::DirAsHash::Blacklist::MatcherWithTail

Inherits:
Object
  • Object
show all
Includes:
Matcher, MatcherFactory
Defined in:
lib/treebis.rb

Direct Known Subclasses

GlobNodeMatcher, StringMatcher

Instance Method Summary collapse

Methods included from MatcherFactory

#create_matcher

Instance Method Details

#include?(str) ⇒ Boolean

Returns:

  • (Boolean)


243
244
245
246
247
248
249
# File 'lib/treebis.rb', line 243

def include? str
  if @tail
    false
  else
    head_include?(str)
  end
end

#submatcher(sub) ⇒ Object



257
258
259
260
261
262
263
# File 'lib/treebis.rb', line 257

def submatcher(sub)
  if head_include?(sub)
    @tail
  else
    nil
  end
end

#tail=(str) ⇒ Object



250
251
252
253
254
255
256
# File 'lib/treebis.rb', line 250

def tail= str
  if str.nil?
    @tail = nil
  else
    @tail = create_matcher(str)
  end
end