class Groat::SMTPD::SMTPResponse

Public Class Methods

new(args = {}) click to toggle source
Calls superclass method Groat::SMTPD::Response::new
# File lib/groat/smtpd/smtpsyntax.rb, line 34
def initialize(args = {})
  @code = args[:code] || 500
  super(args)
end

Public Instance Methods

reply_text() click to toggle source
# File lib/groat/smtpd/smtpsyntax.rb, line 39
def reply_text
  text = ""
  if @message.is_a? Array
    last = @message.pop
    if @message.count > 0
      @message.each do |line|
        text << @code.to_s + "-#{line}\r\n"
      end
    end
    text << @code.to_s + " #{last}\r\n"
  else
    text << @code.to_s + " #{@message}\r\n"
  end
end