Class: Hermeneutics::Cli::LMTP::Response

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(code, msg) ⇒ Response

Returns a new instance of Response.



130
131
132
# File 'lib/hermeneutics/cli/lmtp.rb', line 130

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

Instance Attribute Details

#codeObject (readonly)

Returns the value of attribute code.



128
129
130
# File 'lib/hermeneutics/cli/lmtp.rb', line 128

def code
  @code
end

#msgObject (readonly)

Returns the value of attribute msg.



128
129
130
# File 'lib/hermeneutics/cli/lmtp.rb', line 128

def msg
  @msg
end

Instance Method Details

#error?Boolean

Returns:

  • (Boolean)


141
# File 'lib/hermeneutics/cli/lmtp.rb', line 141

def error?   ; kat == 4 ; end

#fatal?Boolean

Returns:

  • (Boolean)


142
# File 'lib/hermeneutics/cli/lmtp.rb', line 142

def fatal?   ; kat == 5 ; end

#katObject



134
# File 'lib/hermeneutics/cli/lmtp.rb', line 134

def kat ; code / 100 ; end

#ok?Boolean

Returns:

  • (Boolean)


139
# File 'lib/hermeneutics/cli/lmtp.rb', line 139

def ok?      ; kat == 2 ; end

#prelim?Boolean

Returns:

  • (Boolean)


138
# File 'lib/hermeneutics/cli/lmtp.rb', line 138

def prelim?  ; kat == 1 ; end

#to_sObject



136
# File 'lib/hermeneutics/cli/lmtp.rb', line 136

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

#waiting?Boolean

Returns:

  • (Boolean)


140
# File 'lib/hermeneutics/cli/lmtp.rb', line 140

def waiting? ; kat == 3 ; end