Scrubyt::FetchAction

Fetching pages (and related functionality)

Since lot of things are happening during (and before) the fetching of a document, I decided to move out fetching related functionality to a separate class - so if you are looking for anything which is loading a document (even by submitting a form or clicking a link) and related things like setting a proxy etc. you should find it here.

Public Class Methods

get_current_doc_url() click to toggle source

At any given point, the current document can be queried with this method; Typically used when the navigation is over and the result document is passed to the wrapper

# File lib/scrubyt/core/navigation/fetch_action.rb, line 21
def self.get_current_doc_url
  @@current_doc_url
end
get_hpricot_doc() click to toggle source
# File lib/scrubyt/core/navigation/fetch_action.rb, line 29
def self.get_hpricot_doc
  @@hpricot_doc
end
get_mechanize_doc() click to toggle source
# File lib/scrubyt/core/navigation/fetch_action.rb, line 25
def self.get_mechanize_doc
  @@mechanize_doc
end

Public Instance Methods

get_host_name() click to toggle source
# File lib/scrubyt/core/navigation/fetch_action.rb, line 33
def get_host_name
  @@host_name
end
restore_host_name() click to toggle source
# File lib/scrubyt/core/navigation/fetch_action.rb, line 37
def restore_host_name
  return if @@current_doc_protocol == 'file'
  @@host_name = @@original_host_name
end
restore_page() click to toggle source
# File lib/scrubyt/core/navigation/fetch_action.rb, line 46
def restore_page
  @@hpricot_doc = @@history.pop
end
store_host_name(doc_url) click to toggle source
# File lib/scrubyt/core/navigation/fetch_action.rb, line 50
def store_host_name(doc_url)
  FetchAction.store_host_name(doc_url)
end
store_page() click to toggle source
# File lib/scrubyt/core/navigation/fetch_action.rb, line 42
def store_page
  @@history.push @@hpricot_doc
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.