Class: Html2rss::FeedResolution::Diag

Inherits:
Data
  • Object
show all
Defined in:
lib/html2rss/feed_resolution/diag.rb

Overview

Wire-safe diagnostics for one entry-resolution attempt (Status / Marshal edge).

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#appliedObject (readonly)

Returns the value of attribute applied

Returns:

  • (Object)

    the current value of applied



7
8
9
# File 'lib/html2rss/feed_resolution/diag.rb', line 7

def applied
  @applied
end

#probe_countObject (readonly)

Returns the value of attribute probe_count

Returns:

  • (Object)

    the current value of probe_count



7
8
9
# File 'lib/html2rss/feed_resolution/diag.rb', line 7

def probe_count
  @probe_count
end

#reasonObject (readonly)

Returns the value of attribute reason

Returns:

  • (Object)

    the current value of reason



7
8
9
# File 'lib/html2rss/feed_resolution/diag.rb', line 7

def reason
  @reason
end

#winner_scoreObject (readonly)

Returns the value of attribute winner_score

Returns:

  • (Object)

    the current value of winner_score



7
8
9
# File 'lib/html2rss/feed_resolution/diag.rb', line 7

def winner_score
  @winner_score
end

Class Method Details

.from_result(result) ⇒ Diag

Parameters:

Returns:



11
12
13
14
15
16
17
18
# File 'lib/html2rss/feed_resolution/diag.rb', line 11

def self.from_result(result)
  new(
    applied: result.applied,
    probe_count: result.probe_count,
    reason: result.reason,
    winner_score: result.winner_score
  )
end

Instance Method Details

#to_hHash{Symbol => Object}

Returns:

  • (Hash{Symbol => Object})


22
23
24
25
26
27
28
29
# File 'lib/html2rss/feed_resolution/diag.rb', line 22

def to_h
  {
    applied:,
    probe_count:,
    reason:,
    **(winner_score.nil? ? {} : { winner_score: })
  }
end