Class: Jsearch::Main

Inherits:
Object
  • Object
show all
Defined in:
lib/jsearch.rb

Overview

Main class

Instance Method Summary collapse

Constructor Details

#initializeMain

Returns a new instance of Main.



17
18
19
20
21
22
23
24
25
26
27
# File 'lib/jsearch.rb', line 17

def initialize
  @config   = Configuration.instance
  @printer  = Printer.new(@config.silent)
  header

  @searcher = Searcher.new(@config, @printer)

  raise "You need to specify a class to search!" unless @config.cls
rescue StandardError => e
  @printer.error e.message
end