Class: RabbitMQSpec::DSL::World Private

Inherits:
Object
  • Object
show all
Defined in:
lib/rabbitmq-spec/dsl/world.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Class to generate instances for the DSL evaluation

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeWorld

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of World.



10
11
12
13
# File 'lib/rabbitmq-spec/dsl/world.rb', line 10

def initialize
  @exchanges = []
  @single_queues = []
end

Instance Attribute Details

#exchangesArray<RabbitMQSpec::Entity::Exchange>

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns the current value of exchanges.

Returns:



6
7
8
# File 'lib/rabbitmq-spec/dsl/world.rb', line 6

def exchanges
  @exchanges
end

#single_queuesArray<RabbitMQSpec::Entity::Queue>

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns the current value of single_queues.

Returns:



6
7
8
# File 'lib/rabbitmq-spec/dsl/world.rb', line 6

def single_queues
  @single_queues
end

Instance Method Details

#exchange(name) { ... } ⇒ void

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

DSL exchange keyword

Yields:

  • Block to be evaluated on RabbitMQSpec::DSL::Builder::Exchange build proccess



18
19
20
21
# File 'lib/rabbitmq-spec/dsl/world.rb', line 18

def exchange(name, &block)
  new_exchange = RabbitMQSpec::DSL::Builder::Exchange.build(name: name, &block)
  @exchanges << new_exchange
end

#queue(name) { ... } ⇒ void

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

DSL queue keyword

Yields:

  • Block to be evaluated on RabbitMQSpec::DSL::Builder::Exchange build proccess



26
27
28
29
# File 'lib/rabbitmq-spec/dsl/world.rb', line 26

def queue(name, &block)
  new_queue = RabbitMQSpec::DSL::Builder::Queue.build(name: name, &block)
  @single_queues << new_queue
end