Class: Net::NNTP::GroupSelected
- Inherits:
-
OKResponse
- Object
- Response
- OKResponse
- Net::NNTP::GroupSelected
- Includes:
- BodyBaseResponse
- Defined in:
- lib/net/nntp/response.rb
Overview
Code: 211
GroupSelected response.
See Group, Listgroup.
Instance Attribute Summary collapse
-
#group ⇒ Object
readonly
Returns the value of attribute group.
-
#list ⇒ Object
readonly
Returns the value of attribute list.
-
#raw ⇒ Object
readonly
Returns the value of attribute raw.
Attributes inherited from Response
Instance Method Summary collapse
-
#initialize(request, code, message) ⇒ GroupSelected
constructor
A new instance of GroupSelected.
- #parse_body ⇒ Object
Methods included from BodyBaseResponse
Methods inherited from Response
#==, #body, class_from_code, create, #force_close?, #generic?, #has_body?, #multiline?, #needs_article?
Constructor Details
#initialize(request, code, message) ⇒ GroupSelected
Returns a new instance of GroupSelected.
254 255 256 257 258 259 260 261 |
# File 'lib/net/nntp/response.rb', line 254 def initialize(request, code, ) @group = OpenStruct.new tokens = .split raise ProtocolError, "Malformed group message: #{}" unless tokens.size >= 4 @group.number, @group.low, @group.high, @group.name = tokens[0].to_i, tokens[1].to_i, tokens[2].to_i, tokens[3] @body = nil super request, code, , false, Listgroup === request end |
Instance Attribute Details
#group ⇒ Object (readonly)
Returns the value of attribute group.
251 252 253 |
# File 'lib/net/nntp/response.rb', line 251 def group @group end |
#list ⇒ Object (readonly)
Returns the value of attribute list.
251 252 253 |
# File 'lib/net/nntp/response.rb', line 251 def list @list end |
#raw ⇒ Object (readonly)
Returns the value of attribute raw.
252 253 254 |
# File 'lib/net/nntp/response.rb', line 252 def raw @raw end |
Instance Method Details
#parse_body ⇒ Object
262 263 264 265 |
# File 'lib/net/nntp/response.rb', line 262 def parse_body @body=@raw @list = @raw.gsub(/\r?\n\.\r?\n/, '').split(/\r?\n/) end |