Class: Net::NNTP::FormatHeader
- Inherits:
-
Object
- Object
- Net::NNTP::FormatHeader
- Defined in:
- lib/net/nntp/response.rb
Overview
Simple header class to parse headers received from LIST OVERVIEW.FMT
See Net::NNTP::ListInformationFollows
Instance Attribute Summary collapse
-
#full ⇒ Object
readonly
Returns the value of attribute full.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(line) ⇒ FormatHeader
constructor
A new instance of FormatHeader.
Constructor Details
#initialize(line) ⇒ FormatHeader
Returns a new instance of FormatHeader.
11 12 13 14 15 16 17 18 19 |
# File 'lib/net/nntp/response.rb', line 11 def initialize(line) if match = line.match(/^(\S+):(full)?/m) @name = match[1].downcase @full = ('full' == match[2]) elsif match = line.match(/^:(\S+)$/m) @name = match[1].downcase @full = false end end |
Instance Attribute Details
#full ⇒ Object (readonly)
Returns the value of attribute full.
10 11 12 |
# File 'lib/net/nntp/response.rb', line 10 def full @full end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
10 11 12 |
# File 'lib/net/nntp/response.rb', line 10 def name @name end |