class SyslogTls::Message
Message
represents full message that can be sent to syslog
Attributes
header[RW]
msg[RW]
structured_data[RW]
Public Class Methods
new()
click to toggle source
# File lib/syslog_tls/protocol.rb, line 115 def initialize @msg = '' @structured_data = [] @header = Header.new end
Public Instance Methods
assemble()
click to toggle source
# File lib/syslog_tls/protocol.rb, line 121 def assemble # Start with header out = [header.to_s] # Add all structured data if structured_data.length > 0 out << structured_data.map(&:to_s).join('') else out << NIL_VALUE end # Add message out << msg if msg.length > 0 # Message must end with new line delimiter out.join(' ') + "\n" end
to_s()
click to toggle source
# File lib/syslog_tls/protocol.rb, line 136 def to_s assemble end