Class: RedisQueue::Base

Inherits:
Simple show all
Extended by:
ActiveModel::Naming
Includes:
ActiveModel::Conversion, RedisCall::JSON, RedisCall::KeepSerializedElement, RestoreBackupLimit
Defined in:
lib/redis-call/redis_queue.rb

Constant Summary

Constants included from RestoreBackupLimit

RestoreBackupLimit::BACKUP_COUNT_KEY, RestoreBackupLimit::BACKUP_LIMIT

Constants inherited from RedisCall

RedisCall::DEFAULT_HOST, RedisCall::DEFAULT_PORT

Instance Attribute Summary

Attributes inherited from Simple

#config, #name

Instance Method Summary collapse

Methods included from RestoreBackupLimit

#filter_backup_element

Methods included from RedisCall::KeepSerializedElement

#decode, #encode

Methods included from RedisCall::JSON

#decode, #encode

Methods inherited from Simple

all, #backed_up_blocking_pop, #backed_up_pop, #backed_up_pop_all, #backup_elements, #backup_length, #blocking_pop, #blocking_redirect, #decode, #delete, delete, #elements, #encode, #error_length, #error_push, #error_push_raw, #filter_backup_element, #initialize, #length, #pop, #pop_all, #push, #raw_backup_elements, #remove_raw_backup_element, #remove_raw_element, #restore_backup, #watch, #watch_backup

Methods inherited from RedisCall

config=, #connection, #decrzerodelex, #disconnect, #geti, #getnnil, #getnnili, #hgetallarr, #initialize, #insist, #key, #lgetall, #llen, #method_missing, query, #rpushex

Constructor Details

This class inherits a constructor from RedisQueue::Simple

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class RedisCall

Instance Method Details

#action(name) ⇒ Object



249
250
251
# File 'lib/redis-call/redis_queue.rb', line 249

def action name
  @config[:actions] && @config[:actions].find {|action| action[:name] = name.to_s}
end

#idObject



245
246
247
# File 'lib/redis-call/redis_queue.rb', line 245

def id
  @name
end

#persisted?Boolean

Returns:

  • (Boolean)


241
242
243
# File 'lib/redis-call/redis_queue.rb', line 241

def persisted?
  true
end

#requested_action(params) ⇒ Object



253
254
255
# File 'lib/redis-call/redis_queue.rb', line 253

def requested_action params
  @config[:actions] && @config[:actions].find {|action| params[action[:name]]}
end