Class: Typesensual::Callbacks
- Inherits:
-
Object
- Object
- Typesensual::Callbacks
- Defined in:
- lib/typesensual/callbacks.rb
Instance Method Summary collapse
- #after_create_commit(record) ⇒ Object
- #after_destroy_commit(record) ⇒ Object
- #after_update_commit(record) ⇒ Object
-
#initialize(index) ⇒ Callbacks
constructor
A new instance of Callbacks.
Constructor Details
#initialize(index) ⇒ Callbacks
Returns a new instance of Callbacks.
5 6 7 |
# File 'lib/typesensual/callbacks.rb', line 5 def initialize(index) @index = index end |
Instance Method Details
#after_create_commit(record) ⇒ Object
9 10 11 |
# File 'lib/typesensual/callbacks.rb', line 9 def after_create_commit(record) @index.index_one(record.id) end |
#after_destroy_commit(record) ⇒ Object
17 18 19 |
# File 'lib/typesensual/callbacks.rb', line 17 def after_destroy_commit(record) @index.remove_one(record.id) end |
#after_update_commit(record) ⇒ Object
13 14 15 |
# File 'lib/typesensual/callbacks.rb', line 13 def after_update_commit(record) @index.index_one(record.id) end |