Class: Finder

Inherits:
Object
  • Object
show all
Defined in:
lib/rbbt/ner/finder.rb

Defined Under Namespace

Modules: Match Classes: Instance

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path = nil, open_options = {}) ⇒ Finder

Returns a new instance of Finder.



50
51
52
53
# File 'lib/rbbt/ner/finder.rb', line 50

def initialize(path = nil, open_options = {})
  @instances ||= []
  @instances << Finder::Instance.new(path, open_options) unless path.nil?
end

Instance Attribute Details

#instancesObject

Returns the value of attribute instances.



49
50
51
# File 'lib/rbbt/ner/finder.rb', line 49

def instances
  @instances
end

Instance Method Details

#add_instance(path, open_options = {}) ⇒ Object



55
56
57
# File 'lib/rbbt/ner/finder.rb', line 55

def add_instance(path, open_options = {})
  @instances << Finder::Instance.new(path, open_options)
end

#find(name) ⇒ Object



59
60
61
62
63
# File 'lib/rbbt/ner/finder.rb', line 59

def find(name)
  @instances.inject([]) do |acc,instance|
    acc += instance.find(name)
  end
end