Class: Ap4r::AsyncHelper::Converters::ToRailsBase
- Defined in:
- lib/ap4r/async_helper.rb
Direct Known Subclasses
Instance Method Summary collapse
-
#initialize(url_options, async_params, rm_options, url_for_handler) ⇒ ToRailsBase
constructor
A new instance of ToRailsBase.
- #queue_name ⇒ Object
Methods inherited from Base
dispatch_mode, #make_params, #make_rm_options
Constructor Details
#initialize(url_options, async_params, rm_options, url_for_handler) ⇒ ToRailsBase
Returns a new instance of ToRailsBase.
242 243 244 245 246 247 248 249 |
# File 'lib/ap4r/async_helper.rb', line 242 def initialize(, async_params, , url_for_handler) super @url_options ||= {} @url_options[:controller] ||= @url_for_handler.controller_path.gsub("/", ".") @url_options[:url] ||= {:controller => [:controller], :action => [:action]} @url_options[:url][:controller] ||= [:controller] if [:url].kind_of?(Hash) end |
Instance Method Details
#queue_name ⇒ Object
251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 |
# File 'lib/ap4r/async_helper.rb', line 251 def queue_name queue_name = @rm_options[:queue] return queue_name if queue_name queue_prefix = ::Ap4r::AsyncHelper::Base.default_queue_prefix queue_prefix = queue_prefix.chomp(".") url = @url_options[:url] if url.kind_of?(Hash) @rm_options[:queue] ||= [queue_prefix, url[:controller].to_s, url[:action].to_s].join(".") else @rm_options[:queue] ||= "#{queue_prefix}.#{URI.parse(url).path.gsub("/", ".")}" end @rm_options[:queue] end |