Class: NntpScrape::NNTPCommand

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

Direct Known Subclasses

ShortCommand

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#responseObject (readonly)

Returns the value of attribute response.



3
4
5
# File 'lib/nntp_scrape/nntp_command.rb', line 3

def response
  @response
end

#status_lineObject (readonly)

Returns the value of attribute status_line.



3
4
5
# File 'lib/nntp_scrape/nntp_command.rb', line 3

def status_line
  @status_line
end

Instance Method Details

#execute(client) ⇒ Object



13
14
15
# File 'lib/nntp_scrape/nntp_command.rb', line 13

def execute(client)
  raise "implement in subclass"
end

#status_codeObject



9
10
11
# File 'lib/nntp_scrape/nntp_command.rb', line 9

def status_code
  @status_code ||= status_line.split.first
end

#success?Boolean

Returns:

  • (Boolean)


5
6
7
# File 'lib/nntp_scrape/nntp_command.rb', line 5

def success?
  status_code[0] == "2"
end