Class: Rabbit::Receiving::Queue

Inherits:
Object
  • Object
show all
Defined in:
lib/rabbit/receiving/queue.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(raw_message, arguments) ⇒ Queue

Returns a new instance of Queue.



12
13
14
15
16
17
18
# File 'lib/rabbit/receiving/queue.rb', line 12

def initialize(raw_message, arguments)
  @message           = Rabbit::Receiving::Message.build(raw_message, arguments)
  @handler           = Rabbit::Receiving::HandlerResolver.handler_for(message)
  @arguments         = arguments
  @queue_name        = resolved_queue_name
  @ignore_conversion = handler.ignore_queue_conversion
end

Instance Attribute Details

#argumentsObject (readonly)

Returns the value of attribute arguments.



8
9
10
# File 'lib/rabbit/receiving/queue.rb', line 8

def arguments
  @arguments
end

#handlerObject (readonly)

Returns the value of attribute handler.



8
9
10
# File 'lib/rabbit/receiving/queue.rb', line 8

def handler
  @handler
end

#ignore_conversionObject (readonly)

Returns the value of attribute ignore_conversion.



8
9
10
# File 'lib/rabbit/receiving/queue.rb', line 8

def ignore_conversion
  @ignore_conversion
end

#messageObject (readonly)

Returns the value of attribute message.



8
9
10
# File 'lib/rabbit/receiving/queue.rb', line 8

def message
  @message
end

#queue_nameObject (readonly)

Returns the value of attribute queue_name.



8
9
10
# File 'lib/rabbit/receiving/queue.rb', line 8

def queue_name
  @queue_name
end

Instance Method Details

#nameObject



20
21
22
23
24
25
26
27
28
# File 'lib/rabbit/receiving/queue.rb', line 20

def name
  if queue_name
    calculated_queue_name
  else
    Rabbit.default_queue_name(ignore_conversion: ignore_conversion)
  end
rescue
  Rabbit.default_queue_name
end