Class: Stackify::AuthWorker
- Defined in:
- lib/stackify/workers/auth_worker.rb
Instance Attribute Summary
Attributes inherited from Worker
Instance Method Summary collapse
- #after_perform(result) ⇒ Object
-
#initialize(name = 'Authorisation worker') ⇒ AuthWorker
constructor
A new instance of AuthWorker.
Methods inherited from Worker
#alive?, #async_perform, #backtrace, #id, #perform, #shutdown!, #status
Constructor Details
#initialize(name = 'Authorisation worker') ⇒ AuthWorker
Returns a new instance of AuthWorker.
4 5 6 7 |
# File 'lib/stackify/workers/auth_worker.rb', line 4 def initialize name = 'Authorisation worker' super @type = :auth end |
Instance Method Details
#after_perform(result) ⇒ Object
9 10 11 12 13 14 15 16 |
# File 'lib/stackify/workers/auth_worker.rb', line 9 def after_perform result if result.try(:status) == 200 Stackify.send :authorized! Stackify. result else Stackify. result, self end end |