Class: Html2rss::CLI::ProbeView
- Inherits:
-
Data
- Object
- Data
- Html2rss::CLI::ProbeView
- Defined in:
- lib/html2rss/cli/probe_view.rb
Overview
Display-only probe facts for inspect and recon text cards.
Instance Attribute Summary collapse
-
#alternate_feeds ⇒ Object
readonly
Returns the value of attribute alternate_feeds.
-
#articles_count ⇒ Object
readonly
Returns the value of attribute articles_count.
-
#final ⇒ Object
readonly
Returns the value of attribute final.
-
#native_feed ⇒ Object
readonly
Returns the value of attribute native_feed.
-
#notes ⇒ Object
readonly
Returns the value of attribute notes.
-
#requested ⇒ Object
readonly
Returns the value of attribute requested.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
-
#strategy ⇒ Object
readonly
Returns the value of attribute strategy.
-
#surface ⇒ Object
readonly
Returns the value of attribute surface.
-
#verdict ⇒ Object
readonly
Returns the value of attribute verdict.
Class Method Summary collapse
Instance Attribute Details
#alternate_feeds ⇒ Object (readonly)
Returns the value of attribute alternate_feeds
7 8 9 |
# File 'lib/html2rss/cli/probe_view.rb', line 7 def alternate_feeds @alternate_feeds end |
#articles_count ⇒ Object (readonly)
Returns the value of attribute articles_count
7 8 9 |
# File 'lib/html2rss/cli/probe_view.rb', line 7 def articles_count @articles_count end |
#final ⇒ Object (readonly)
Returns the value of attribute final
7 8 9 |
# File 'lib/html2rss/cli/probe_view.rb', line 7 def final @final end |
#native_feed ⇒ Object (readonly)
Returns the value of attribute native_feed
7 8 9 |
# File 'lib/html2rss/cli/probe_view.rb', line 7 def native_feed @native_feed end |
#notes ⇒ Object (readonly)
Returns the value of attribute notes
7 8 9 |
# File 'lib/html2rss/cli/probe_view.rb', line 7 def notes @notes end |
#requested ⇒ Object (readonly)
Returns the value of attribute requested
7 8 9 |
# File 'lib/html2rss/cli/probe_view.rb', line 7 def requested @requested end |
#status ⇒ Object (readonly)
Returns the value of attribute status
7 8 9 |
# File 'lib/html2rss/cli/probe_view.rb', line 7 def status @status end |
#strategy ⇒ Object (readonly)
Returns the value of attribute strategy
7 8 9 |
# File 'lib/html2rss/cli/probe_view.rb', line 7 def strategy @strategy end |
#surface ⇒ Object (readonly)
Returns the value of attribute surface
7 8 9 |
# File 'lib/html2rss/cli/probe_view.rb', line 7 def surface @surface end |
#verdict ⇒ Object (readonly)
Returns the value of attribute verdict
7 8 9 |
# File 'lib/html2rss/cli/probe_view.rb', line 7 def verdict @verdict end |
Class Method Details
.from_recon(result) ⇒ ProbeView
41 42 43 44 45 46 47 48 49 50 51 52 53 54 |
# File 'lib/html2rss/cli/probe_view.rb', line 41 def from_recon(result) # rubocop:disable Metrics/MethodLength new( requested: result.requested_url.to_s, final: result.final_url.to_s, status: result.status, surface: result.surface_category, articles_count: result.articles_count, verdict: result.verdict, native_feed: result.native_feed&.to_s, alternate_feeds: [], notes: result.notes, strategy: nil ) end |
.from_wire(data) ⇒ ProbeView
23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/html2rss/cli/probe_view.rb', line 23 def from_wire(data) # rubocop:disable Metrics/MethodLength new( requested: wire_val(data, :requested_url), final: wire_val(data, :final_url), status: wire_val(data, :status), surface: wire_val(data, :surface_category), articles_count: wire_val(data, :articles_count), verdict: nil, native_feed: nil, alternate_feeds: wire_val(data, :alternate_feeds) || [], notes: [], strategy: wire_val(data, :strategy) ) end |
.wire_val(data, key) ⇒ Object?
60 61 62 |
# File 'lib/html2rss/cli/probe_view.rb', line 60 def wire_val(data, key) data[key] || data[key.to_s] end |