Class: Html2rss::Test::QualityReport
- Inherits:
-
Data
- Object
- Data
- Html2rss::Test::QualityReport
- Defined in:
- lib/html2rss/test.rb
Overview
Ship-quality audit summary for a configuration test (warn-only).
Instance Attribute Summary collapse
-
#defer_reason ⇒ Object
readonly
Returns the value of attribute defer_reason.
-
#metrics ⇒ Object
readonly
Returns the value of attribute metrics.
-
#native_feed ⇒ Object
readonly
Returns the value of attribute native_feed.
-
#warnings ⇒ Object
readonly
Returns the value of attribute warnings.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#defer_reason ⇒ Object (readonly)
Returns the value of attribute defer_reason
64 65 66 |
# File 'lib/html2rss/test.rb', line 64 def defer_reason @defer_reason end |
#metrics ⇒ Object (readonly)
Returns the value of attribute metrics
64 65 66 |
# File 'lib/html2rss/test.rb', line 64 def metrics @metrics end |
#native_feed ⇒ Object (readonly)
Returns the value of attribute native_feed
64 65 66 |
# File 'lib/html2rss/test.rb', line 64 def native_feed @native_feed end |
#warnings ⇒ Object (readonly)
Returns the value of attribute warnings
64 65 66 |
# File 'lib/html2rss/test.rb', line 64 def warnings @warnings end |
Class Method Details
.from_audit(audit, native_feed: nil) ⇒ QualityReport
79 80 81 82 83 84 85 86 87 |
# File 'lib/html2rss/test.rb', line 79 def self.from_audit(audit, native_feed: nil) report_warnings = audit.warnings.dup defer_reason = nil if native_feed report_warnings << :native_feed_present unless report_warnings.include?(:native_feed_present) defer_reason = :native_feed end new(warnings: report_warnings.freeze, metrics: audit.metrics, native_feed:, defer_reason:) end |
Instance Method Details
#to_h ⇒ Hash{Symbol => Object}
67 68 69 70 71 72 73 |
# File 'lib/html2rss/test.rb', line 67 def to_h { warnings: warnings.map(&:to_s), metrics:, **(native_feed ? { native_feed:, defer_reason: defer_reason.to_s } : {}) }.compact end |