module MergingQueue::Actor
Public Instance Methods
publish_queued_task(name, cur_publish_on, options={})
click to toggle source
Publishes the queued_task to the receivers
@param [ Hash ] options The options to publish with.
@example publish an queued_task with a act_object and act_target
current_user.publish_queued_task(:enquiry, :act_object => @enquiry, :act_target => @listing)
# File lib/merging-queue/actor.rb, line 32 def publish_queued_task(name, cur_publish_on, options={}) cur_publish_on = Time.now + cur_publish_on if cur_publish_on.kind_of?(Fixnum) raise "Expected Time type. Got:" + cur_publish_on.class.name unless cur_publish_on.kind_of?(Time) queued_task_class.publish(name, cur_publish_on, {:actor => self}.merge(options)) end
queued_merging_tasks(options = {})
click to toggle source
# File lib/merging-queue/actor.rb, line 42 def queued_merging_tasks(options = {}) if options.empty? queued_tasks else queued_tasks.where(options) end end
queued_task_class()
click to toggle source
# File lib/merging-queue/actor.rb, line 38 def queued_task_class @queued_task_klass ||= queued_task_klass ? queued_task_klass.classify.constantize : ::QueuedTask end