Class: SimpleCrawler::Document

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#dataObject

Returns the value of attribute data.



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

def data
  @data
end

#fetched_atObject

Returns the value of attribute fetched_at.



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

def fetched_at
  @fetched_at
end

#headersObject

Returns the value of attribute headers.



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

def headers
  @headers
end

#http_statusObject

Returns the value of attribute http_status.



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

def http_status
  @http_status
end

#uriObject

Returns the value of attribute uri.



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

def uri
  @uri
end

Instance Method Details

#to_sObject



5
6
7
8
9
10
11
12
13
14
15
# File 'lib/document.rb', line 5

def to_s
  puts "Document"
  puts " .uri:\t\t#{uri}"
  puts " .fetched_at:\t#{fetched_at}"
  puts " .http_status:\t#{http_status}"
  puts " .headers:"
  for header in headers
    puts "   #{header[0]}: #{header[1]}"
  end
  puts " .data.length:\t#{(data.length)}"   
end