Class: Crawlscope::Page
- Inherits:
-
Object
- Object
- Crawlscope::Page
- Defined in:
- lib/crawlscope/page.rb
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#doc ⇒ Object
readonly
Returns the value of attribute doc.
-
#error ⇒ Object
readonly
Returns the value of attribute error.
-
#final_url ⇒ Object
readonly
Returns the value of attribute final_url.
-
#headers ⇒ Object
readonly
Returns the value of attribute headers.
-
#normalized_final_url ⇒ Object
readonly
Returns the value of attribute normalized_final_url.
-
#normalized_url ⇒ Object
readonly
Returns the value of attribute normalized_url.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Instance Method Summary collapse
- #html? ⇒ Boolean
-
#initialize(url:, normalized_url:, final_url:, normalized_final_url:, status:, headers:, body:, doc:, error: nil) ⇒ Page
constructor
A new instance of Page.
Constructor Details
#initialize(url:, normalized_url:, final_url:, normalized_final_url:, status:, headers:, body:, doc:, error: nil) ⇒ Page
Returns a new instance of Page.
7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/crawlscope/page.rb', line 7 def initialize(url:, normalized_url:, final_url:, normalized_final_url:, status:, headers:, body:, doc:, error: nil) @url = url @normalized_url = normalized_url @final_url = final_url @normalized_final_url = normalized_final_url @status = status @headers = headers || {} @body = body @doc = doc @error = error end |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
5 6 7 |
# File 'lib/crawlscope/page.rb', line 5 def body @body end |
#doc ⇒ Object (readonly)
Returns the value of attribute doc.
5 6 7 |
# File 'lib/crawlscope/page.rb', line 5 def doc @doc end |
#error ⇒ Object (readonly)
Returns the value of attribute error.
5 6 7 |
# File 'lib/crawlscope/page.rb', line 5 def error @error end |
#final_url ⇒ Object (readonly)
Returns the value of attribute final_url.
5 6 7 |
# File 'lib/crawlscope/page.rb', line 5 def final_url @final_url end |
#headers ⇒ Object (readonly)
Returns the value of attribute headers.
5 6 7 |
# File 'lib/crawlscope/page.rb', line 5 def headers @headers end |
#normalized_final_url ⇒ Object (readonly)
Returns the value of attribute normalized_final_url.
5 6 7 |
# File 'lib/crawlscope/page.rb', line 5 def normalized_final_url @normalized_final_url end |
#normalized_url ⇒ Object (readonly)
Returns the value of attribute normalized_url.
5 6 7 |
# File 'lib/crawlscope/page.rb', line 5 def normalized_url @normalized_url end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
5 6 7 |
# File 'lib/crawlscope/page.rb', line 5 def status @status end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
5 6 7 |
# File 'lib/crawlscope/page.rb', line 5 def url @url end |
Instance Method Details
#html? ⇒ Boolean
19 20 21 |
# File 'lib/crawlscope/page.rb', line 19 def html? !doc.nil? end |