Class: Net::NNTP::HeaderResponse
- Inherits:
-
ArticleBaseResponse
- Object
- Response
- OKResponse
- ArticleBaseResponse
- Net::NNTP::HeaderResponse
- Includes:
- BodyBaseResponse
- Defined in:
- lib/net/nntp/response.rb
Overview
Code: 221
- CAVEAT
-
according to RFC 2980, an XHDR request will trigger a 221 response, but with a TOTALLY different format. THANKS, IDIOTS (fucking on a heap of barbed wire …)
Instance Attribute Summary collapse
-
#list ⇒ Object
readonly
Returns the value of attribute list.
Attributes inherited from ArticleBaseResponse
Attributes inherited from Response
Instance Method Summary collapse
Methods included from BodyBaseResponse
Methods inherited from ArticleBaseResponse
Methods inherited from Response
#==, #body, class_from_code, create, #force_close?, #generic?, #has_body?, #initialize, #multiline?, #needs_article?
Constructor Details
This class inherits a constructor from Net::NNTP::ArticleBaseResponse
Instance Attribute Details
#list ⇒ Object (readonly)
Returns the value of attribute list.
358 359 360 |
# File 'lib/net/nntp/response.rb', line 358 def list @list end |
Instance Method Details
#[](header) ⇒ Object
379 380 381 382 |
# File 'lib/net/nntp/response.rb', line 379 def [](header) return @article[header].to_s if @article nil end |
#header ⇒ Object
383 384 385 386 |
# File 'lib/net/nntp/response.rb', line 383 def header return @article.header if @article nil end |
#parse_body ⇒ Object
359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 |
# File 'lib/net/nntp/response.rb', line 359 def parse_body unless @article if Xhdr === @request @xhdr = true @list = {} @raw.split(/\r?\n/).each do |line| number, value = line.split(/\t/) @list[number.to_i] = value end elsif Head === @request @xhdr = false begin @article = TMail::Mail.new @article.__send__(:parse_header, StringIO.new(@raw)) rescue TMail::SyntaxError end end end end |