Method: MQTT::Packet::Unsubscribe#encode_body

Defined in:
lib/mqtt/packet.rb

#encode_bodyObject

Get serialisation of packet’s body



911
912
913
914
915
916
# File 'lib/mqtt/packet.rb', line 911

def encode_body
  raise 'no topics given when serialising packet' if @topics.empty?
  body = encode_short(@id)
  topics.each { |topic| body += encode_string(topic) }
  body
end