Class: Treebis::DirAsHash::Blacklist

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

Defined Under Namespace

Modules: Matcher, MatcherFactory Classes: EmptyMatcherClass, GlobNodeMatcher, GlobNodeMatcherDeep, MatcherWithTail, StringMatcher

Instance Method Summary collapse

Methods included from MatcherFactory

create_matcher

Instance Method Details

#include?(str) ⇒ Boolean

Returns:

  • (Boolean)


212
213
214
# File 'lib/treebis.rb', line 212

def include? str
  @matchers.detect{ |x| x.include?(str) }
end

#submatcher(str) ⇒ Object



215
216
217
218
219
220
221
222
223
224
225
226
227
228
# File 'lib/treebis.rb', line 215

def submatcher str
  these = []
  @matchers.each do |m|
    this = m.submatcher(str)
    these.push(this) if this
  end
  ret =
  if these.empty?
    nil
  else
    Blacklist.new(these)
  end
  ret
end