Class: MongoidSilo::UpdateSiloWorker
- Inherits:
-
Object
- Object
- MongoidSilo::UpdateSiloWorker
- Includes:
- Sidekiq::Worker
- Defined in:
- app/workers/mongoid_silo/update_silo_worker.rb
Instance Attribute Summary collapse
-
#callback ⇒ Object
readonly
Returns the value of attribute callback.
-
#generator ⇒ Object
readonly
Returns the value of attribute generator.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#klass ⇒ Object
readonly
Returns the value of attribute klass.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
Instance Attribute Details
#callback ⇒ Object (readonly)
Returns the value of attribute callback.
13 14 15 |
# File 'app/workers/mongoid_silo/update_silo_worker.rb', line 13 def callback @callback end |
#generator ⇒ Object (readonly)
Returns the value of attribute generator.
13 14 15 |
# File 'app/workers/mongoid_silo/update_silo_worker.rb', line 13 def generator @generator end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
13 14 15 |
# File 'app/workers/mongoid_silo/update_silo_worker.rb', line 13 def id @id end |
#klass ⇒ Object (readonly)
Returns the value of attribute klass.
13 14 15 |
# File 'app/workers/mongoid_silo/update_silo_worker.rb', line 13 def klass @klass end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
13 14 15 |
# File 'app/workers/mongoid_silo/update_silo_worker.rb', line 13 def name @name end |
Instance Method Details
#perform(id, klass, name, mode = :save, generator = nil, callback = nil) ⇒ Object
15 16 17 18 19 20 21 22 23 |
# File 'app/workers/mongoid_silo/update_silo_worker.rb', line 15 def perform(id, klass, name, mode = :save, generator = nil, callback = nil) @id = id.kind_of?(String) ? id : id["$oid"] @klass = klass.constantize @generator = generator ? generator.constantize : nil @callback = callback @name = name __send__(mode.to_sym) end |