Exception: Groat::SMTPD::Response

Inherits:
Exception
  • Object
show all
Defined in:
lib/groat/smtpd/base.rb

Direct Known Subclasses

SMTPResponse

Instance Method Summary collapse

Constructor Details

#initialize(args = {}) ⇒ Response

Returns a new instance of Response.



28
29
30
31
# File 'lib/groat/smtpd/base.rb', line 28

def initialize(args = {})
  @message = args[:message] || "Unknown"
  @terminate = args[:terminate] || false
end

Instance Method Details

#reply_textObject



37
38
39
40
41
42
43
# File 'lib/groat/smtpd/base.rb', line 37

def reply_text
  if @message.is_a? Array
    @message.join("\r\n") + "\r\n"
  else
    @message.to_s + "\r\n"
  end
end

#terminate?Boolean

Returns:

  • (Boolean)


33
34
35
# File 'lib/groat/smtpd/base.rb', line 33

def terminate?
  @terminate
end