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 114
def initialize
  @msg = ''
  @structured_data = []
end

Public Instance Methods

assemble() click to toggle source
# File lib/syslog_tls/protocol.rb, line 123
def assemble
  # Start with header
  out = [header.to_s]
  # 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 119
def header
  @header ||= Header.new
end
to_s() click to toggle source
# File lib/syslog_tls/protocol.rb, line 132
def to_s
  assemble
end