class SyslogTls::Message
Message
represents full message that can be sent to syslog
Attributes
header[W]
msg[RW]
structured_data[RW]
Public Class Methods
new()
click to toggle source
# File lib/syslog_tls/protocol.rb, line 117 def initialize @msg = '' @structured_data = [] end
Public Instance Methods
assemble()
click to toggle source
# File lib/syslog_tls/protocol.rb, line 126 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
header()
click to toggle source
# File lib/syslog_tls/protocol.rb, line 122 def header @header ||= Header.new end
to_s()
click to toggle source
# File lib/syslog_tls/protocol.rb, line 141 def to_s assemble end