Class: Net::NNTP::NewgroupsResponse

Inherits:
GroupListResponse show all
Defined in:
lib/net/nntp/response.rb

Overview

Code: 231

Instance Attribute Summary

Attributes inherited from GroupListResponse

#list, #raw

Attributes inherited from Response

#code, #message, #request

Instance Method Summary collapse

Methods inherited from GroupListResponse

#initialize

Methods included from BodyBaseResponse

#body, #body=

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::GroupListResponse

Instance Method Details

#parse_bodyObject



453
454
455
456
457
458
459
# File 'lib/net/nntp/response.rb', line 453

def parse_body
  @raw.split(/\r?\n/).each do |line|
    break if line == '.'
    name, low, high, status = line.split(/\s+/)
    @list << OpenStruct.new(:name => name, :low => low.to_i, :high => high.to_i, :status => status.strip)
  end unless @raw.nil?
end