Class: AMQP::Client::Exchange
- Inherits:
-
Object
- Object
- AMQP::Client::Exchange
- Defined in:
- lib/amqp/client/exchange.rb
Overview
High level representation of an exchange
Instance Method Summary collapse
-
#bind(exchange, binding_key, arguments: {}) ⇒ Exchange
Bind to another exchange.
-
#delete ⇒ nil
Delete the exchange.
-
#publish(body, routing_key, **properties) ⇒ Exchange
Publish to the exchange.
-
#unbind(exchange, binding_key, arguments: {}) ⇒ Exchange
Unbind from another exchange.
Instance Method Details
#bind(exchange, binding_key, arguments: {}) ⇒ Exchange
Bind to another exchange
43 44 45 46 |
# File 'lib/amqp/client/exchange.rb', line 43 def bind(exchange, binding_key, arguments: {}) @client.exchange_bind(@name, exchange, binding_key, arguments: arguments) self end |
#delete ⇒ nil
Delete the exchange
60 61 62 63 |
# File 'lib/amqp/client/exchange.rb', line 60 def delete @client.delete_exchange(@name) nil end |
#publish(body, routing_key, **properties) ⇒ Exchange
Publish to the exchange
33 34 35 36 |
# File 'lib/amqp/client/exchange.rb', line 33 def publish(body, routing_key, **properties) @client.publish(body, @name, routing_key, **properties) self end |
#unbind(exchange, binding_key, arguments: {}) ⇒ Exchange
Unbind from another exchange
53 54 55 56 |
# File 'lib/amqp/client/exchange.rb', line 53 def unbind(exchange, binding_key, arguments: {}) @client.exchange_unbind(@name, exchange, binding_key, arguments: arguments) self end |