Class: Push::Producer

Inherits:
Object
  • Object
show all
Defined in:
lib/push/producer.rb

Overview

Give us a really easy way to publish messages to an MQ exchange. This is MQ agnostic so that it works in a test environment.

Defined Under Namespace

Classes: DSL

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeProducer

Returns a new instance of Producer.



18
19
20
# File 'lib/push/producer.rb', line 18

def initialize
  @backend = Backend.adapter
end

Instance Attribute Details

#backendObject (readonly)

Returns the value of attribute backend.



5
6
7
# File 'lib/push/producer.rb', line 5

def backend
  @backend
end

Instance Method Details

#publish(message) ⇒ Object



22
23
24
# File 'lib/push/producer.rb', line 22

def publish(message)
  DSL.new(backend, message)
end