Class: Net::NNTP::Ihave

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

Overview

RFC 3977

IHAVE request.

Valid Responses: TransferOK, TransferArticle, ArticleNotWanted, TransferNotPossible, TransferRejected

Instance Method Summary collapse

Methods inherited from PostingRequest

#body, #body=

Methods inherited from Request

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

Constructor Details

#initialize(id, body = nil) ⇒ Ihave

  • id is the messageid that will be presented to the server. Will be superficially formally checked

  • body is the posting that should be subsequently posted on a good response (335). It MUST NOT be dot-stuffed.

See also: Post, PostingRequest, TransferOK, TransferArticle, ArticleNotWanted, TransferNotPossible, TransferRejected

Raises:



622
623
624
625
626
627
# File 'lib/net/nntp/request.rb', line 622

def initialize(id, body=nil) 
  raise ParameterError,"Messageid must not be nil!" unless id 
  raise ParameterError,"Malformed messageid" unless id.match(/<.+@.+>/)
  self.body = body unless body.nil?
  super "IHAVE", id
end

Instance Method Details

#capabilityObject



634
635
636
# File 'lib/net/nntp/request.rb', line 634

def capability
  'ihave'
end