Class: Msgr::Message

Inherits:
Object
  • Object
show all
Includes:
Acknowledge
Defined in:
lib/msgr/message.rb,
lib/msgr/message/acknowledge.rb

Defined Under Namespace

Modules: Acknowledge

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Acknowledge

#ack, #acked?

Constructor Details

#initialize(connection, delivery_info, metadata, payload, route) ⇒ Message

Returns a new instance of Message.



9
10
11
12
13
14
15
16
17
18
19
# File 'lib/msgr/message.rb', line 9

def initialize(connection, delivery_info, , payload, route)
  @connection    = connection
  @delivery_info = delivery_info
        = 
  @payload       = payload
  @route         = route

  if content_type == 'application/json'
    @payload = JSON[payload].symbolize_keys
  end
end

Instance Attribute Details

#delivery_infoObject (readonly)

Returns the value of attribute delivery_info.



7
8
9
# File 'lib/msgr/message.rb', line 7

def delivery_info
  @delivery_info
end

#metadataObject (readonly)

Returns the value of attribute metadata.



7
8
9
# File 'lib/msgr/message.rb', line 7

def 
  
end

#payloadObject (readonly)

Returns the value of attribute payload.



7
8
9
# File 'lib/msgr/message.rb', line 7

def payload
  @payload
end

#routeObject (readonly)

Returns the value of attribute route.



7
8
9
# File 'lib/msgr/message.rb', line 7

def route
  @route
end

Instance Method Details

#content_typeObject



21
22
23
# File 'lib/msgr/message.rb', line 21

def content_type
  .content_type
end