Class: Net::NNTP::List
Overview
Instance Attribute Summary collapse
-
#keyword ⇒ Object
readonly
Returns the value of attribute keyword.
Instance Method Summary collapse
- #capability ⇒ Object
-
#initialize(keyword = nil, rest = {}) ⇒ List
constructor
keywordmust be nil or one of ACTIVE, ACTIVE.TIMES, DISTRIB.PATS, HEADERS, NEWSGROUPS or OVERVIEW.FMT.
- #valid_responses ⇒ Object
Methods inherited from Request
#command, #dotstuff, #msgid_or_range, #range, #valid_response?
Constructor Details
#initialize(keyword = nil, rest = {}) ⇒ List
keywordmust be nil or one of ACTIVE, ACTIVE.TIMES, DISTRIB.PATS, HEADERS, NEWSGROUPS or OVERVIEW.FMT.restcan be a string or a hash with either the key :msgid or the keys :start and optionally :end to denote a range.
Example
request = Net::NNTP::List.new # => LIST request = Net::NNTP::List.new('ACTIVE') # => LIST ACTIVE request = Net::NNTP::List.new('ACTIVE.TIMES', 'at.') # => LIST ACTIVE at. request = Net::NNTP::List.new('HEADERS', :msgid => '<this.is@invalid>') # => LIST HEADERS <this.is@invalid> request = Net::NNTP::List.new('HEADERS', :start => 123, :end => 456) # => LIST HEADERS 123-456
723 724 725 726 727 728 729 |
# File 'lib/net/nntp/request.rb', line 723 def initialize(keyword=nil, rest={}) Net::NNTP.logger.debug("Keyword: <#{keyword}>") @keyword = keyword.strip.upcase if keyword parameters = (@keyword ? @keyword.dup : '') parameters << ' ' << msgid_or_range(rest) super 'LIST', parameters end |
Instance Attribute Details
#keyword ⇒ Object (readonly)
Returns the value of attribute keyword.
711 712 713 |
# File 'lib/net/nntp/request.rb', line 711 def keyword @keyword end |
Instance Method Details
#capability ⇒ Object
735 736 737 |
# File 'lib/net/nntp/request.rb', line 735 def capability 'list' end |
#valid_responses ⇒ Object
731 732 733 |
# File 'lib/net/nntp/request.rb', line 731 def valid_responses [ListInformationFollows] end |