Class: Hermeneutics::Cli::SMTP::Response

Inherits:
Object
  • Object
show all
Defined in:
lib/hermeneutics/cli/smtp.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(code, msg) ⇒ Response

Returns a new instance of Response.



170
171
172
# File 'lib/hermeneutics/cli/smtp.rb', line 170

def initialize code, msg
  @code, @msg = code, msg
end

Instance Attribute Details

#codeObject (readonly)

Returns the value of attribute code.



168
169
170
# File 'lib/hermeneutics/cli/smtp.rb', line 168

def code
  @code
end

#msgObject (readonly)

Returns the value of attribute msg.



168
169
170
# File 'lib/hermeneutics/cli/smtp.rb', line 168

def msg
  @msg
end

Instance Method Details

#error?Boolean

Returns:

  • (Boolean)


181
# File 'lib/hermeneutics/cli/smtp.rb', line 181

def error?   ; kat == 4 ; end

#fatal?Boolean

Returns:

  • (Boolean)


182
# File 'lib/hermeneutics/cli/smtp.rb', line 182

def fatal?   ; kat == 5 ; end

#katObject



174
# File 'lib/hermeneutics/cli/smtp.rb', line 174

def kat ; code / 100 ; end

#ok?Boolean

Returns:

  • (Boolean)


179
# File 'lib/hermeneutics/cli/smtp.rb', line 179

def ok?      ; kat == 2 ; end

#prelim?Boolean

Returns:

  • (Boolean)


178
# File 'lib/hermeneutics/cli/smtp.rb', line 178

def prelim?  ; kat == 1 ; end

#to_sObject



176
# File 'lib/hermeneutics/cli/smtp.rb', line 176

def to_s ; "%03d %s" % [ @code, @msg] ; end

#waiting?Boolean

Returns:

  • (Boolean)


180
# File 'lib/hermeneutics/cli/smtp.rb', line 180

def waiting? ; kat == 3 ; end