Class: Net::IMAP::ResponseParser
- Inherits:
-
Object
- Object
- Net::IMAP::ResponseParser
- Extended by:
- ParserUtils::Generator
- Includes:
- ParserUtils, ResponseConditions
- Defined in:
- lib/net/imap/response_parser.rb,
lib/net/imap/response_parser/parser_utils.rb
Overview
Parses an IMAP server response.
Defined Under Namespace
Modules: ParserUtils, Patterns, ResponseConditions Classes: Token
Constant Summary
Constants included from ParserUtils::Generator
ParserUtils::Generator::LOOKAHEAD, ParserUtils::Generator::SHIFT_TOKEN
Constants included from ResponseConditions
ResponseConditions::AUTH_CONDS, ResponseConditions::BAD, ResponseConditions::BYE, ResponseConditions::GREETING_CONDS, ResponseConditions::NO, ResponseConditions::OK, ResponseConditions::PREAUTH, ResponseConditions::RESP_CONDS, ResponseConditions::RESP_COND_STATES, ResponseConditions::RESP_DATA_CONDS
Instance Method Summary collapse
-
#initialize ⇒ ResponseParser
constructor
:call-seq: Net::IMAP::ResponseParser.new -> Net::IMAP::ResponseParser.
-
#parse(str) ⇒ Object
:call-seq: parse(str) -> ContinuationRequest parse(str) -> UntaggedResponse parse(str) -> TaggedResponse.
Methods included from ParserUtils::Generator
def_char_matchers, def_token_matchers
Constructor Details
#initialize ⇒ ResponseParser
:call-seq: Net::IMAP::ResponseParser.new -> Net::IMAP::ResponseParser
15 16 17 18 19 20 |
# File 'lib/net/imap/response_parser.rb', line 15 def initialize @str = nil @pos = nil @lex_state = nil @token = nil end |
Instance Method Details
#parse(str) ⇒ Object
:call-seq:
parse(str) -> ContinuationRequest
parse(str) -> UntaggedResponse
parse(str) -> TaggedResponse
Raises ResponseParseError for unparsable strings.
28 29 30 31 32 33 34 |
# File 'lib/net/imap/response_parser.rb', line 28 def parse(str) @str = str @pos = 0 @lex_state = EXPR_BEG @token = nil return response end |