Module: ResqueAdmin::Helpers
- Included in:
- ResqueAdmin, Job, Job, Worker, Worker
- Defined in:
- lib/resque_admin/helpers.rb
Overview
Methods used by various classes in ResqueAdmin.
Defined Under Namespace
Classes: DecodeException
Instance Method Summary collapse
-
#classify(dashed_word) ⇒ Object
Given a word with dashes, returns a camel cased version of it.
-
#constantize(camel_cased_word) ⇒ Object
Tries to find a constant with the name specified in the argument string.
-
#decode(object) ⇒ Object
Given a string, returns a Ruby object.
-
#encode(object) ⇒ Object
Given a Ruby object, returns a string suitable for storage in a queue.
-
#redis ⇒ Object
Direct access to the Redis instance.
Instance Method Details
#classify(dashed_word) ⇒ Object
Given a word with dashes, returns a camel cased version of it.
39 40 41 |
# File 'lib/resque_admin/helpers.rb', line 39 def classify(dashed_word) ResqueAdmin.classify(dashed_word) end |
#constantize(camel_cased_word) ⇒ Object
Tries to find a constant with the name specified in the argument string
44 45 46 |
# File 'lib/resque_admin/helpers.rb', line 44 def constantize(camel_cased_word) ResqueAdmin.constantize(camel_cased_word) end |
#decode(object) ⇒ Object
Given a string, returns a Ruby object.
34 35 36 |
# File 'lib/resque_admin/helpers.rb', line 34 def decode(object) ResqueAdmin.decode(object) end |
#encode(object) ⇒ Object
Given a Ruby object, returns a string suitable for storage in a queue.
29 30 31 |
# File 'lib/resque_admin/helpers.rb', line 29 def encode(object) ResqueAdmin.encode(object) end |
#redis ⇒ Object
Direct access to the Redis instance.
17 18 19 20 21 22 23 24 25 |
# File 'lib/resque_admin/helpers.rb', line 17 def redis # No infinite recursions, please. # Some external libraries depend on ResqueAdmin::Helpers being mixed into # ResqueAdmin, but this method causes recursions. If we have a super method, # assume it is canonical. (see #1150) return super if defined?(super) ResqueAdmin.redis end |