Class: PyramidScheme::IndexServer
- Inherits:
-
Object
- Object
- PyramidScheme::IndexServer
- Defined in:
- lib/pyramid_scheme/index_server.rb
Instance Attribute Summary collapse
-
#configuration ⇒ Object
readonly
Returns the value of attribute configuration.
-
#index_provider ⇒ Object
readonly
Returns the value of attribute index_provider.
-
#indexer_class ⇒ Object
readonly
Returns the value of attribute indexer_class.
Instance Method Summary collapse
-
#index ⇒ Object
run the index.
- #indexer ⇒ Object
-
#initialize(options = {}) ⇒ IndexServer
constructor
initializes a new index server.
Constructor Details
#initialize(options = {}) ⇒ IndexServer
initializes a new index server
7 8 9 10 11 |
# File 'lib/pyramid_scheme/index_server.rb', line 7 def initialize( = {}) @configuration = PyramidScheme::Configuration.new @index_provider = @configuration[:index_provider_class].new @indexer_class = @configuration[:indexer_class] end |
Instance Attribute Details
#configuration ⇒ Object (readonly)
Returns the value of attribute configuration.
3 4 5 |
# File 'lib/pyramid_scheme/index_server.rb', line 3 def configuration @configuration end |
#index_provider ⇒ Object (readonly)
Returns the value of attribute index_provider.
3 4 5 |
# File 'lib/pyramid_scheme/index_server.rb', line 3 def index_provider @index_provider end |
#indexer_class ⇒ Object (readonly)
Returns the value of attribute indexer_class.
3 4 5 |
# File 'lib/pyramid_scheme/index_server.rb', line 3 def indexer_class @indexer_class end |
Instance Method Details
#index ⇒ Object
run the index
19 20 21 22 23 24 25 26 27 |
# File 'lib/pyramid_scheme/index_server.rb', line 19 def index kill_searchd unless @configuration[:permit_server_daemon] create_lock_file indexer.configure indexer.index destroy_lock_file bounce_searchd index_provider.process_index end |
#indexer ⇒ Object
14 15 16 |
# File 'lib/pyramid_scheme/index_server.rb', line 14 def indexer @indexer ||= @indexer_class.new end |