Class: Net::NNTP::OverviewInformation
- Inherits:
-
ArticleBaseResponse
- Object
- Response
- OKResponse
- ArticleBaseResponse
- Net::NNTP::OverviewInformation
- Includes:
- BodyBaseResponse
- Defined in:
- lib/net/nntp/response.rb
Overview
Code: 224
Instance Attribute Summary collapse
-
#bytes ⇒ Object
readonly
Returns the value of attribute bytes.
-
#date ⇒ Object
readonly
Returns the value of attribute date.
-
#from ⇒ Object
readonly
Returns the value of attribute from.
-
#lines ⇒ Object
readonly
Returns the value of attribute lines.
-
#optional_headers ⇒ Object
readonly
Returns the value of attribute optional_headers.
-
#references ⇒ Object
readonly
Returns the value of attribute references.
-
#subject ⇒ Object
readonly
Returns the value of attribute subject.
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
#bytes ⇒ Object (readonly)
Returns the value of attribute bytes.
406 407 408 |
# File 'lib/net/nntp/response.rb', line 406 def bytes @bytes end |
#date ⇒ Object (readonly)
Returns the value of attribute date.
406 407 408 |
# File 'lib/net/nntp/response.rb', line 406 def date @date end |
#from ⇒ Object (readonly)
Returns the value of attribute from.
406 407 408 |
# File 'lib/net/nntp/response.rb', line 406 def from @from end |
#lines ⇒ Object (readonly)
Returns the value of attribute lines.
406 407 408 |
# File 'lib/net/nntp/response.rb', line 406 def lines @lines end |
#optional_headers ⇒ Object (readonly)
Returns the value of attribute optional_headers.
406 407 408 |
# File 'lib/net/nntp/response.rb', line 406 def optional_headers @optional_headers end |
#references ⇒ Object (readonly)
Returns the value of attribute references.
406 407 408 |
# File 'lib/net/nntp/response.rb', line 406 def references @references end |
#subject ⇒ Object (readonly)
Returns the value of attribute subject.
406 407 408 |
# File 'lib/net/nntp/response.rb', line 406 def subject @subject end |
Instance Method Details
#parse_body ⇒ Object
407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 |
# File 'lib/net/nntp/response.rb', line 407 def parse_body raw = @raw.gsub(/\r\n\.\r\n/, '') number, subject, from, date, , references, bytes, lines, *rest = raw.strip.split(/\t/) @number = number.to_i @subject = subject @from = from @date = DateTime.parse(date) @message_id = @references = references.split(/\s/) @bytes = bytes.to_i @lines = lines.to_i @optional_headers = {} if rest rest.each do |line| header, value = line.split(/:\s+/) optional_headers[header.downcase] = value end end end |