class Xapian::Indexer::Spider::Fetch
Attributes
controller[R]
current_resource[R]
database[R]
Public Class Methods
new(database, controller, link)
click to toggle source
# File lib/xapian/indexer/spider.rb, line 57 def initialize(database, controller, link) @database = database @controller = controller @document = false @current_resource = controller.create(link) @archived_resource = false end
Public Instance Methods
archived_resource()
click to toggle source
# File lib/xapian/indexer/spider.rb, line 84 def archived_resource if @archived_resource === false if document @archived_resource = @controller.recreate(document.data) end end return @archived_resource end
document()
click to toggle source
# File lib/xapian/indexer/spider.rb, line 70 def document if @document === false postlist = @database.postlist(@current_resource.name_digest) if postlist.size > 0 @document = @database.document(postlist[0].docid) else @document = nil end end return @document end
links()
click to toggle source
# File lib/xapian/indexer/spider.rb, line 94 def links #$stderr.puts "current_resource.links = #{@current_resource.links.inspect}" if @current_resource #$stderr.puts "archived_resource.links = #{archived_resource.links.inspect}" if archived_resource if @current_resource.fetched? @current_resource.links elsif archived_resource archived_resource.links end end