Class: Net::NNTP::Capabilities

Inherits:
InformationRequest show all
Defined in:
lib/net/nntp/request.rb

Overview

RFC 3977

CAPABILITIES Request. Should be used to discover the commands that the server can process. Can change if MODE or authentication changes the state of the connection. Sadly, most servers do not implement this, leaving either the option to parse the informal response to a HELP request, or use trial-and-error.

Usage Example

nntp = Net::NNTP.new
nntp.server = 'localhost'
nntp.connect
request = Capabilities.new
response = nntp.process(request)
response.capabilities['version'] # returns the version, either as number, or array of numbers, i.e. [2, 3]

Valid Response: CapabilityList

Instance Method Summary collapse

Methods inherited from Request

#capability, #command, #dotstuff, #msgid_or_range, #range, #valid_response?

Constructor Details

#initializeCapabilities

Returns a new instance of Capabilities.



195
196
197
# File 'lib/net/nntp/request.rb', line 195

def initialize
  super 'CAPABILITIES'
end