Class: BunnyMock::MessageProperties

Inherits:
Object
  • Object
show all
Includes:
Enumerable
Defined in:
lib/bunny_mock/message_properties.rb

Instance Method Summary collapse

Instance Method Details

#[](key) ⇒ Object

Access properties by key

See Also:

  • Hash#[]


28
29
30
# File 'lib/bunny_mock/message_properties.rb', line 28

def [](key)
  @properties[key]
end

#app_idString

Returns Publishing application, as set by the publisher.

Returns:

  • (String)

    Publishing application, as set by the publisher



104
105
106
# File 'lib/bunny_mock/message_properties.rb', line 104

def app_id
  @properties[:app_id]
end

#cluster_idString

Returns Cluster ID, as set by the publisher.

Returns:

  • (String)

    Cluster ID, as set by the publisher



109
110
111
# File 'lib/bunny_mock/message_properties.rb', line 109

def cluster_id
  @properties[:cluster_id]
end

#content_encodingString

Returns (Optional) content encoding of the message, as set by the publisher.

Returns:

  • (String)

    (Optional) content encoding of the message, as set by the publisher



49
50
51
# File 'lib/bunny_mock/message_properties.rb', line 49

def content_encoding
  @properties[:content_encoding]
end

#content_typeString

Returns (Optional) content type of the message, as set by the publisher.

Returns:

  • (String)

    (Optional) content type of the message, as set by the publisher



44
45
46
# File 'lib/bunny_mock/message_properties.rb', line 44

def content_type
  @properties[:content_type]
end

#correlation_idString

Returns What message this message is a reply to (or corresponds to), as set by the publisher.

Returns:

  • (String)

    What message this message is a reply to (or corresponds to), as set by the publisher



69
70
71
# File 'lib/bunny_mock/message_properties.rb', line 69

def correlation_id
  @properties[:correlation_id]
end

#delivery_modeInteger

Returns Delivery mode (persistent or transient).

Returns:

  • (Integer)

    Delivery mode (persistent or transient)



59
60
61
# File 'lib/bunny_mock/message_properties.rb', line 59

def delivery_mode
  @properties[:delivery_mode]
end

#each(*args, &block) ⇒ Object

Iterate over the properties

See Also:

  • Enumerable#each


22
23
24
# File 'lib/bunny_mock/message_properties.rb', line 22

def each(*args, &block)
  @properties.each(*args, &block)
end

#expirationString

Returns Message expiration, as set by the publisher.

Returns:

  • (String)

    Message expiration, as set by the publisher



79
80
81
# File 'lib/bunny_mock/message_properties.rb', line 79

def expiration
  @properties[:expiration]
end

#headersString

Returns Message headers.

Returns:

  • (String)

    Message headers



54
55
56
# File 'lib/bunny_mock/message_properties.rb', line 54

def headers
  @properties[:headers]
end

#message_idString

Returns Message ID, as set by the publisher.

Returns:

  • (String)

    Message ID, as set by the publisher



84
85
86
# File 'lib/bunny_mock/message_properties.rb', line 84

def message_id
  @properties[:message_id]
end

#priorityInteger

Returns Message priority, as set by the publisher.

Returns:

  • (Integer)

    Message priority, as set by the publisher



64
65
66
# File 'lib/bunny_mock/message_properties.rb', line 64

def priority
  @properties[:priority]
end

#reply_toString

Returns (Optional) How to reply to the publisher (usually a reply queue name).

Returns:

  • (String)

    (Optional) How to reply to the publisher (usually a reply queue name)



74
75
76
# File 'lib/bunny_mock/message_properties.rb', line 74

def reply_to
  @properties[:reply_to]
end

#timestampTime

Returns Message timestamp, as set by the publisher.

Returns:

  • (Time)

    Message timestamp, as set by the publisher



89
90
91
# File 'lib/bunny_mock/message_properties.rb', line 89

def timestamp
  @properties[:timestamp]
end

#to_hashHash

Returns Hash of message properties.

Returns:

  • (Hash)

    Hash of message properties



33
34
35
# File 'lib/bunny_mock/message_properties.rb', line 33

def to_hash
  @properties
end

#to_sString Also known as: inspect

Returns String representation of message properties.

Returns:

  • (String)

    String representation of message properties



38
39
40
# File 'lib/bunny_mock/message_properties.rb', line 38

def to_s
  to_hash.to_s
end

#typeString

Returns Message type, as set by the publisher.

Returns:

  • (String)

    Message type, as set by the publisher



94
95
96
# File 'lib/bunny_mock/message_properties.rb', line 94

def type
  @properties[:type]
end

#user_idString

Returns Publishing user, as set by the publisher.

Returns:

  • (String)

    Publishing user, as set by the publisher



99
100
101
# File 'lib/bunny_mock/message_properties.rb', line 99

def user_id
  @properties[:user_id]
end