Class: Leveret::Message

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/leveret/message.rb

Overview

Roll up all of the separate parts of an incoming message into a nice convenient object to move around

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(delivery_info, properties, params) ⇒ Message

Returns a new instance of Message.

Parameters:

  • delivery_info (Bunny::DeliveryInfo)

    Full of useful things like the delivery_tag and routing key

  • properties (Bunny::Properties)

    Full of useful things like content-type and priority

  • Deserialized (Parameters)

    params parsed from the message



21
22
23
24
25
# File 'lib/leveret/message.rb', line 21

def initialize(delivery_info, properties, params)
  self.delivery_info = delivery_info
  self.properties = properties
  self.params = params
end

Instance Attribute Details

#delivery_infoBunny::DeliveryInfo

Returns Full of useful things like the delivery_tag and routing key.

Returns:

  • (Bunny::DeliveryInfo)

    Full of useful things like the delivery_tag and routing key



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/leveret/message.rb', line 10

class Message
  extend Forwardable

  attr_accessor :delivery_info, :properties, :params

  def_delegators :delivery_info, :delivery_tag, :routing_key
  def_delegators :properties, :priority

  # @param [Bunny::DeliveryInfo] delivery_info Full of useful things like the delivery_tag and routing key
  # @param [Bunny::Properties] properties Full of useful things like content-type and priority
  # @param [Parameters] Deserialized params parsed from the message
  def initialize(delivery_info, properties, params)
    self.delivery_info = delivery_info
    self.properties = properties
    self.params = params
  end
end

#paramsParameters

Returns Deserialized params.

Returns:



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/leveret/message.rb', line 10

class Message
  extend Forwardable

  attr_accessor :delivery_info, :properties, :params

  def_delegators :delivery_info, :delivery_tag, :routing_key
  def_delegators :properties, :priority

  # @param [Bunny::DeliveryInfo] delivery_info Full of useful things like the delivery_tag and routing key
  # @param [Bunny::Properties] properties Full of useful things like content-type and priority
  # @param [Parameters] Deserialized params parsed from the message
  def initialize(delivery_info, properties, params)
    self.delivery_info = delivery_info
    self.properties = properties
    self.params = params
  end
end

#propertiesDelivery::Properties

Returns Full of useful things like content-type and priority.

Returns:

  • (Delivery::Properties)

    Full of useful things like content-type and priority



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/leveret/message.rb', line 10

class Message
  extend Forwardable

  attr_accessor :delivery_info, :properties, :params

  def_delegators :delivery_info, :delivery_tag, :routing_key
  def_delegators :properties, :priority

  # @param [Bunny::DeliveryInfo] delivery_info Full of useful things like the delivery_tag and routing key
  # @param [Bunny::Properties] properties Full of useful things like content-type and priority
  # @param [Parameters] Deserialized params parsed from the message
  def initialize(delivery_info, properties, params)
    self.delivery_info = delivery_info
    self.properties = properties
    self.params = params
  end
end