Sha256: 021ed7675e01fae6f43c1ac8d7ea3f96f023febb8dd66730c8f63b8bf842dc0d

Contents?: true

Size: 565 Bytes

Versions: 17

Compression:

Stored size: 565 Bytes

Contents

require 'rhosync/ping'

module Rhosync
  module PingJob
    @queue = :ping
    
    # Perform a ping for all clients registered to a user
    def self.perform(params)
      user = User.load(params["user_id"])
      user.clients.members.each do |client_id|
        client = Client.load(client_id,{:source_name => '*'})
        params.merge!('device_port' => client.device_port,
          'device_pin' => client.device_pin)        
        klass = Object.const_get(camelize(client.device_type.downcase))
        klass.ping(params) if klass
      end
    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
rhosync-2.0.2 lib/rhosync/jobs/ping_job.rb
rhosync-2.0.1 lib/rhosync/jobs/ping_job.rb
rhosync-2.0.0 lib/rhosync/jobs/ping_job.rb
rhosync-2.0.0.rc2 lib/rhosync/jobs/ping_job.rb
rhosync-2.0.0.rc1 lib/rhosync/jobs/ping_job.rb
rhosync-2.0.0.beta13 lib/rhosync/jobs/ping_job.rb
rhosync-2.0.0.beta12 lib/rhosync/jobs/ping_job.rb
rhosync-2.0.0.beta11 lib/rhosync/jobs/ping_job.rb
rhosync-2.0.0.beta10 lib/rhosync/jobs/ping_job.rb
rhosync-2.0.0.beta9 lib/rhosync/jobs/ping_job.rb
rhosync-2.0.0.beta8 lib/rhosync/jobs/ping_job.rb
rhosync-2.0.0.beta7 lib/rhosync/jobs/ping_job.rb
rhosync-2.0.0.beta6 lib/rhosync/jobs/ping_job.rb
rhosync-2.0.0.beta4 lib/rhosync/jobs/ping_job.rb
rhosync-2.0.0.beta3 lib/rhosync/jobs/ping_job.rb
rhosync-2.0.0.beta2 lib/rhosync/jobs/ping_job.rb
rhosync-2.0.0.beta1 lib/rhosync/jobs/ping_job.rb