class StompServer::StompFrame

Attributes

body[RW]
command[RW]
headers[RW]

Public Instance Methods

dest() click to toggle source
# File lib/stomp_server/stomp_frame.rb, line 22
def dest
  #@dest || (@dest = @headers['destination'])
  @headers['destination']
end
to_s() click to toggle source
# File lib/stomp_server/stomp_frame.rb, line 11
def to_s
  result = @command + "\n"
  @headers['content-length'] = @body.size.to_s if @body.include?(0)
  @headers.each_pair do |key, value|
    result << "#{key}:#{value}\n"
  end
  result << "\n"
  result << @body.to_s
  result << "\0000\n"  
end

Public Class Methods

new(command=nil, headers=nil, body=nil) click to toggle source
# File lib/stomp_server/stomp_frame.rb, line 5
def initialize(command=nil, headers=nil, body=nil)
  @command = command
  @headers = headers || {}
  @body = body || ''
end