Class: Bri::Search::Class

Inherits:
Base
  • Object
show all
Defined in:
lib/bri/search/class.rb

Instance Attribute Summary

Attributes inherited from Base

#matches, #term

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from Bri::Search::Base

Instance Method Details

#search(type = :fully_qualified) ⇒ Object



5
6
7
8
9
10
# File 'lib/bri/search/class.rb', line 5

def search( type = :fully_qualified )
  # NOTE: classes are only searched as fully qualified for the time being
  # FIXME: What do we do if more than one store defines the same class?
  store = Bri::Mall.instance.stores.detect { |s| s.modules.include? @term }
  @matches << Bri::Match::Class.new( store.load_class( @term ) ) if store
end