Class: Pose::Jobs::Remove
- Inherits:
-
Object
- Object
- Pose::Jobs::Remove
- Defined in:
- lib/pose/jobs/remove.rb
Overview
Removes the Pose search index for the given class.
Instance Attribute Summary collapse
-
#klass ⇒ Object
readonly
Returns the value of attribute klass.
Instance Method Summary collapse
-
#initialize(clazz) ⇒ Remove
constructor
A new instance of Remove.
- #perform ⇒ Object
Constructor Details
#initialize(clazz) ⇒ Remove
Returns a new instance of Remove.
11 12 13 14 15 16 17 18 19 20 |
# File 'lib/pose/jobs/remove.rb', line 11 def initialize(clazz) @klass = case clazz when String clazz.constantize when Class clazz else raise ArgumentError, "Class or String expected, #{clazz.class} given" end end |
Instance Attribute Details
#klass ⇒ Object (readonly)
Returns the value of attribute klass.
8 9 10 |
# File 'lib/pose/jobs/remove.rb', line 8 def klass @klass end |
Instance Method Details
#perform ⇒ Object
22 23 24 25 |
# File 'lib/pose/jobs/remove.rb', line 22 def perform Pose::Assignment.delete_class_index(klass) puts "Search index for class #{klass.name} deleted.\n\n" end |