Class: Net::NNTP::FormatHeader

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

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

#fullObject (readonly)

Returns the value of attribute full.



10
11
12
# File 'lib/net/nntp/response.rb', line 10

def full
  @full
end

#nameObject (readonly)

Returns the value of attribute name.



10
11
12
# File 'lib/net/nntp/response.rb', line 10

def name
  @name
end