Class: Push::Backend::Test

Inherits:
Object
  • Object
show all
Includes:
Logging
Defined in:
lib/push/backend.rb

Instance Method Summary collapse

Instance Method Details

#exchangeObject



46
47
48
# File 'lib/push/backend.rb', line 46

def exchange
  @exchange ||= Hash.new {|h,k| h[k] = []} # Default hash empty hash values with an array (instead of nil)
end

#publish(message, exchange_name) ⇒ Object



41
42
43
44
# File 'lib/push/backend.rb', line 41

def publish(message, exchange_name)
  logger.debug "Published '#{message}' to exchange #{exchange}"
  exchange[exchange_name] << message
end