module Resque::Helpers

Methods used by various classes in Resque.

Public Instance Methods

classify(dashed_word) click to toggle source

Given a word with dashes, returns a camel cased version of it.

# File lib/resque/helpers.rb, line 39
def classify(dashed_word)
  Resque.classify(dashed_word)
end
constantize(camel_cased_word) click to toggle source

Tries to find a constant with the name specified in the argument string

# File lib/resque/helpers.rb, line 44
def constantize(camel_cased_word)
  Resque.constantize(camel_cased_word)
end
decode(object) click to toggle source

Given a string, returns a Ruby object.

# File lib/resque/helpers.rb, line 34
def decode(object)
  Resque.decode(object)
end
encode(object) click to toggle source

Given a Ruby object, returns a string suitable for storage in a queue.

# File lib/resque/helpers.rb, line 29
def encode(object)
  Resque.encode(object)
end
redis() click to toggle source

Direct access to the Redis instance.

Calls superclass method
# File lib/resque/helpers.rb, line 17
def redis
  # No infinite recursions, please.
  # Some external libraries depend on Resque::Helpers being mixed into
  # Resque, but this method causes recursions. If we have a super method,
  # assume it is canonical. (see #1150)
  return super if defined?(super)

  Resque.redis
end