Class: Heatwave::Crawler::FetchOutcome
- Inherits:
-
Data
- Object
- Data
- Heatwave::Crawler::FetchOutcome
- Defined in:
- app/services/heatwave/crawler/fetch_outcome.rb
Overview
Internal per-tier attempt result. Tiers always return an outcome (never
raise / never nil); the crawler decides whether to accept it or escalate.
+fatal: true+ stops escalation immediately (PDF detected by the direct
tier, Oxylabs budget exhausted) — the crawler returns a failure Result
carrying +error+ instead of trying further tiers.
Instance Attribute Summary collapse
-
#details ⇒ Object
readonly
Returns the value of attribute details.
-
#error ⇒ Object
readonly
Returns the value of attribute error.
-
#fatal ⇒ Object
readonly
Returns the value of attribute fatal.
-
#final_url ⇒ Object
readonly
Returns the value of attribute final_url.
-
#headers ⇒ Object
readonly
Returns the value of attribute headers.
-
#html ⇒ Object
readonly
Returns the value of attribute html.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
-
#tier ⇒ Object
readonly
Returns the value of attribute tier.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Instance Method Summary collapse
- #fatal? ⇒ Boolean
-
#initialize(tier: nil, url: nil, final_url: nil, status: nil, html: nil, headers: {}, details: {}, error: nil, fatal: nil) ⇒ FetchOutcome
constructor
A new instance of FetchOutcome.
Constructor Details
#initialize(tier: nil, url: nil, final_url: nil, status: nil, html: nil, headers: {}, details: {}, error: nil, fatal: nil) ⇒ FetchOutcome
Returns a new instance of FetchOutcome.
13 14 15 16 |
# File 'app/services/heatwave/crawler/fetch_outcome.rb', line 13 def initialize(tier: nil, url: nil, final_url: nil, status: nil, html: nil, headers: {}, details: {}, error: nil, fatal: nil) super end |
Instance Attribute Details
#details ⇒ Object (readonly)
Returns the value of attribute details
10 11 12 |
# File 'app/services/heatwave/crawler/fetch_outcome.rb', line 10 def details @details end |
#error ⇒ Object (readonly)
Returns the value of attribute error
10 11 12 |
# File 'app/services/heatwave/crawler/fetch_outcome.rb', line 10 def error @error end |
#fatal ⇒ Object (readonly)
Returns the value of attribute fatal
10 11 12 |
# File 'app/services/heatwave/crawler/fetch_outcome.rb', line 10 def fatal @fatal end |
#final_url ⇒ Object (readonly)
Returns the value of attribute final_url
10 11 12 |
# File 'app/services/heatwave/crawler/fetch_outcome.rb', line 10 def final_url @final_url end |
#headers ⇒ Object (readonly)
Returns the value of attribute headers
10 11 12 |
# File 'app/services/heatwave/crawler/fetch_outcome.rb', line 10 def headers @headers end |
#html ⇒ Object (readonly)
Returns the value of attribute html
10 11 12 |
# File 'app/services/heatwave/crawler/fetch_outcome.rb', line 10 def html @html end |
#status ⇒ Object (readonly)
Returns the value of attribute status
10 11 12 |
# File 'app/services/heatwave/crawler/fetch_outcome.rb', line 10 def status @status end |
#tier ⇒ Object (readonly)
Returns the value of attribute tier
10 11 12 |
# File 'app/services/heatwave/crawler/fetch_outcome.rb', line 10 def tier @tier end |
#url ⇒ Object (readonly)
Returns the value of attribute url
10 11 12 |
# File 'app/services/heatwave/crawler/fetch_outcome.rb', line 10 def url @url end |
Instance Method Details
#fatal? ⇒ Boolean
18 |
# File 'app/services/heatwave/crawler/fetch_outcome.rb', line 18 def fatal? = fatal == true |