Class: Hermeneutics::Cli::SMTP::Response
- Inherits:
-
Object
- Object
- Hermeneutics::Cli::SMTP::Response
- Defined in:
- lib/hermeneutics/cli/smtp.rb
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#msg ⇒ Object
readonly
Returns the value of attribute msg.
Instance Method Summary collapse
- #error? ⇒ Boolean
- #fatal? ⇒ Boolean
-
#initialize(code, msg) ⇒ Response
constructor
A new instance of Response.
- #kat ⇒ Object
- #ok? ⇒ Boolean
- #prelim? ⇒ Boolean
- #to_s ⇒ Object
- #waiting? ⇒ Boolean
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
#code ⇒ Object (readonly)
Returns the value of attribute code.
168 169 170 |
# File 'lib/hermeneutics/cli/smtp.rb', line 168 def code @code end |
#msg ⇒ Object (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
181 |
# File 'lib/hermeneutics/cli/smtp.rb', line 181 def error? ; kat == 4 ; end |
#fatal? ⇒ Boolean
182 |
# File 'lib/hermeneutics/cli/smtp.rb', line 182 def fatal? ; kat == 5 ; end |
#kat ⇒ Object
174 |
# File 'lib/hermeneutics/cli/smtp.rb', line 174 def kat ; code / 100 ; end |
#ok? ⇒ Boolean
179 |
# File 'lib/hermeneutics/cli/smtp.rb', line 179 def ok? ; kat == 2 ; end |
#prelim? ⇒ Boolean
178 |
# File 'lib/hermeneutics/cli/smtp.rb', line 178 def prelim? ; kat == 1 ; end |
#to_s ⇒ Object
176 |
# File 'lib/hermeneutics/cli/smtp.rb', line 176 def to_s ; "%03d %s" % [ @code, @msg] ; end |
#waiting? ⇒ Boolean
180 |
# File 'lib/hermeneutics/cli/smtp.rb', line 180 def waiting? ; kat == 3 ; end |