Sha256: 339aa05ff56a25f3e22b85d649385514cc3900175224e6616cc316e9662914c3

Contents?: true

Size: 1.11 KB

Versions: 21

Compression:

Stored size: 1.11 KB

Contents

module Rhoconnect
	module Handler
		module Changes
			module Hooks
				def self.handler_installed(controller, rc_handler, verb, route_url, options)
	  			queue_key = "#{verb}:#{route_url}"
	  			# QUEUE key is unique per route
	  			# standard routes - should go to the standard :create, :update, :delete queues
	  			case queue_key
	  			when "post:/", "put:/:id", "delete:/id"
	  				queue_key = nil
	  			end

	  			queue_names = []
	  			case rc_handler.to_sym
	  			when :cud
	  				queue_names << (queue_key ? "create:#{queue_key}" : "create")
	  				queue_names << (queue_key ? "update:#{queue_key}" : "update")
	  				queue_names << (queue_key ? "delete:#{queue_key}" : "delete")
	  			when :create
	  				queue_names << (queue_key ? "create:#{queue_key}" : "create")
	  			when :update
	  				queue_names << (queue_key ? "update:#{queue_key}" : "update")
	  			when :delete
	  				queue_names << (queue_key ? "delete:#{queue_key}" : "delete")
	  			else
	  				return true
	  			end

	  			Source.define_valid_queues(queue_names)
	  			options[:add_parameter] = {:queue_key => queue_key} if queue_key
	  		end
			end
		end
	end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
rhoconnect-7.6.0 lib/rhoconnect/handler/changes/hooks.rb
rhoconnect-7.5.1 lib/rhoconnect/handler/changes/hooks.rb
rhoconnect-7.4.1 lib/rhoconnect/handler/changes/hooks.rb
rhoconnect-7.1.17 lib/rhoconnect/handler/changes/hooks.rb
rhoconnect-6.2.0 lib/rhoconnect/handler/changes/hooks.rb
rhoconnect-6.0.11 lib/rhoconnect/handler/changes/hooks.rb
rhoconnect-5.5.18 lib/rhoconnect/handler/changes/hooks.rb
rhoconnect-5.5.17 lib/rhoconnect/handler/changes/hooks.rb
rhoconnect-5.5.15 lib/rhoconnect/handler/changes/hooks.rb
rhoconnect-5.5.0.22 lib/rhoconnect/handler/changes/hooks.rb
rhoconnect-5.5.2 lib/rhoconnect/handler/changes/hooks.rb
rhoconnect-5.5.0.7 lib/rhoconnect/handler/changes/hooks.rb
rhoconnect-5.5.0.3 lib/rhoconnect/handler/changes/hooks.rb
rhoconnect-5.5.0 lib/rhoconnect/handler/changes/hooks.rb
rhoconnect-5.1.1 lib/rhoconnect/handler/changes/hooks.rb
rhoconnect-4.0.4 lib/rhoconnect/handler/changes/hooks.rb
rhoconnect-4.0.3 lib/rhoconnect/handler/changes/hooks.rb
rhoconnect-4.0.2 lib/rhoconnect/handler/changes/hooks.rb
rhoconnect-4.0.1 lib/rhoconnect/handler/changes/hooks.rb
rhoconnect-4.0.0 lib/rhoconnect/handler/changes/hooks.rb