class Devise::Async::Worker

Public Class Methods

enqueue(method, resource_class, resource_id, *args) click to toggle source

Used is the internal interface for devise-async to enqueue notifications to the desired backend.

# File lib/devise/async/worker.rb, line 8
def enqueue(method, resource_class, resource_id, *args)
  # convert args to strings and hashes with string keys before passing to backend
  args = stringify_args args
  backend_class.enqueue(method, resource_class, resource_id, *args)
end

Private Class Methods

backend_class() click to toggle source
# File lib/devise/async/worker.rb, line 29
def backend_class
  Backend.for(Devise::Async.backend)
end
stringify_args(args) click to toggle source
# File lib/devise/async/worker.rb, line 16
def stringify_args(args)
  args.map do |a|
    case a
      when Hash
        a.stringify_keys
      when Symbol
        a.to_s
      else
        a
    end
  end
end