Class: NntpScrape::LongCommand

Inherits:
ShortCommand show all
Defined in:
lib/nntp_scrape/nntp_command.rb

Instance Attribute Summary collapse

Attributes inherited from NNTPCommand

#response, #status_line

Instance Method Summary collapse

Methods inherited from NNTPCommand

#status_code, #success?

Instance Attribute Details

#linesObject (readonly)

Returns the value of attribute lines.



27
28
29
# File 'lib/nntp_scrape/nntp_command.rb', line 27

def lines
  @lines
end

Instance Method Details

#execute(client) ⇒ Object



29
30
31
32
33
34
35
36
37
38
# File 'lib/nntp_scrape/nntp_command.rb', line 29

def execute(client)
  super client
        
  @lines = []
  loop do
    next_line = socket.gets
    break if next_line.strip == "."
    @lines << next_line
  end
end