Class: Heatwave::Crawler::FetchOutcome

Inherits:
Data
  • Object
show all
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

Instance Method Summary collapse

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

#detailsObject (readonly)

Returns the value of attribute details

Returns:

  • (Object)

    the current value of details



10
11
12
# File 'app/services/heatwave/crawler/fetch_outcome.rb', line 10

def details
  @details
end

#errorObject (readonly)

Returns the value of attribute error

Returns:

  • (Object)

    the current value of error



10
11
12
# File 'app/services/heatwave/crawler/fetch_outcome.rb', line 10

def error
  @error
end

#fatalObject (readonly)

Returns the value of attribute fatal

Returns:

  • (Object)

    the current value of fatal



10
11
12
# File 'app/services/heatwave/crawler/fetch_outcome.rb', line 10

def fatal
  @fatal
end

#final_urlObject (readonly)

Returns the value of attribute final_url

Returns:

  • (Object)

    the current value of final_url



10
11
12
# File 'app/services/heatwave/crawler/fetch_outcome.rb', line 10

def final_url
  @final_url
end

#headersObject (readonly)

Returns the value of attribute headers

Returns:

  • (Object)

    the current value of headers



10
11
12
# File 'app/services/heatwave/crawler/fetch_outcome.rb', line 10

def headers
  @headers
end

#htmlObject (readonly)

Returns the value of attribute html

Returns:

  • (Object)

    the current value of html



10
11
12
# File 'app/services/heatwave/crawler/fetch_outcome.rb', line 10

def html
  @html
end

#statusObject (readonly)

Returns the value of attribute status

Returns:

  • (Object)

    the current value of status



10
11
12
# File 'app/services/heatwave/crawler/fetch_outcome.rb', line 10

def status
  @status
end

#tierObject (readonly)

Returns the value of attribute tier

Returns:

  • (Object)

    the current value of tier



10
11
12
# File 'app/services/heatwave/crawler/fetch_outcome.rb', line 10

def tier
  @tier
end

#urlObject (readonly)

Returns the value of attribute url

Returns:

  • (Object)

    the current value of url



10
11
12
# File 'app/services/heatwave/crawler/fetch_outcome.rb', line 10

def url
  @url
end

Instance Method Details

#fatal?Boolean

Returns:

  • (Boolean)


18
# File 'app/services/heatwave/crawler/fetch_outcome.rb', line 18

def fatal? = fatal == true