Module: Net::NNTPBodyParser

Included in:
NNTPArticle, NNTPBodyResponse
Defined in:
lib/net/nntp/response/parsers.rb

Instance Method Summary collapse

Instance Method Details

#parse_body(raw_body) ⇒ Object


67
68
69
70
71
72
73
74
75
# File 'lib/net/nntp/response/parsers.rb', line 67

def parse_body(raw_body)
  body = ''
  raw_body.each_line do |line|
    range = line[0] == '.' ? 1..-1 : 0..-1
    body << line[range]
  end

  body.chomp! # chomp trailing \r\n
end