Class: ReFe::FunctionSearcher
- Inherits:
-
Object
- Object
- ReFe::FunctionSearcher
- Includes:
- Encoding
- Defined in:
- lib/refe/searcher.rb
Instance Method Summary collapse
-
#initialize(table, policy) ⇒ FunctionSearcher
constructor
A new instance of FunctionSearcher.
- #search(keys) ⇒ Object
Methods included from Encoding
#adjust_encoding, #shift_jis_platform?
Constructor Details
#initialize(table, policy) ⇒ FunctionSearcher
Returns a new instance of FunctionSearcher.
153 154 155 156 |
# File 'lib/refe/searcher.rb', line 153 def initialize( table, policy ) @table = table @policy = policy end |
Instance Method Details
#search(keys) ⇒ Object
158 159 160 161 162 163 164 165 166 167 |
# File 'lib/refe/searcher.rb', line 158 def search( keys ) results = @table.complete(keys) if @policy.should_print_content?(results) results.sort.each do |name| puts adjust_encoding(@table[name]) end else @policy.print_names results end end |