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.



45
46
47
48
# File 'lib/rbbt/ner/finder.rb', line 45

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.



44
45
46
# File 'lib/rbbt/ner/finder.rb', line 44

def instances
  @instances
end

Instance Method Details

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



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

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

#find(name) ⇒ Object



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

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