Class: Fetcher::Imap::Types::Response
- Inherits:
-
Object
- Object
- Fetcher::Imap::Types::Response
- Defined in:
- lib/bas/fetcher/imap/types/response.rb
Overview
Represents a response received from the Imap client. It encapsulates essential information about the response, providing a structured way to handle and analyze it’s responses.
Instance Attribute Summary collapse
-
#message ⇒ Object
readonly
Returns the value of attribute message.
-
#results ⇒ Object
readonly
Returns the value of attribute results.
-
#status_code ⇒ Object
readonly
Returns the value of attribute status_code.
Instance Method Summary collapse
-
#initialize(response) ⇒ Response
constructor
A new instance of Response.
Constructor Details
#initialize(response) ⇒ Response
Returns a new instance of Response.
13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/bas/fetcher/imap/types/response.rb', line 13 def initialize(response) if response.empty? @status_code = 404 @message = "no result were found" @results = [] else @status_code = 200 @message = "success" @results = response end end |
Instance Attribute Details
#message ⇒ Object (readonly)
Returns the value of attribute message.
11 12 13 |
# File 'lib/bas/fetcher/imap/types/response.rb', line 11 def @message end |
#results ⇒ Object (readonly)
Returns the value of attribute results.
11 12 13 |
# File 'lib/bas/fetcher/imap/types/response.rb', line 11 def results @results end |
#status_code ⇒ Object (readonly)
Returns the value of attribute status_code.
11 12 13 |
# File 'lib/bas/fetcher/imap/types/response.rb', line 11 def status_code @status_code end |