Class: Lifesaver::Indexing::Indexer
- Inherits:
-
Object
- Object
- Lifesaver::Indexing::Indexer
- Defined in:
- lib/lifesaver/indexing/indexer.rb
Instance Method Summary collapse
-
#initialize(args) ⇒ Indexer
constructor
A new instance of Indexer.
- #perform ⇒ Object
Constructor Details
#initialize(args) ⇒ Indexer
Returns a new instance of Indexer.
4 5 6 7 8 |
# File 'lib/lifesaver/indexing/indexer.rb', line 4 def initialize(args) @class_name = args.fetch(:class_name) @model_id = args.fetch(:model_id) @operation = args.fetch(:operation).to_sym end |
Instance Method Details
#perform ⇒ Object
10 11 12 13 14 15 16 17 |
# File 'lib/lifesaver/indexing/indexer.rb', line 10 def perform case operation when :update store when :destroy remove end end |