Class: Html2rss::FeedResolution::Options
- Inherits:
-
Data
- Object
- Data
- Html2rss::FeedResolution::Options
- Defined in:
- lib/html2rss/feed_resolution/options.rb
Overview
Typed auto_source.entry_resolution options (one expansion from config Hash).
Instance Attribute Summary collapse
-
#enabled ⇒ Object
readonly
Returns the value of attribute enabled.
-
#max_probes ⇒ Object
readonly
Returns the value of attribute max_probes.
Class Method Summary collapse
Instance Method Summary collapse
- #enabled? ⇒ Boolean
-
#request_slots ⇒ Integer
Probe slots plus one Orchestrator retry GET when enabled.
Instance Attribute Details
#enabled ⇒ Object (readonly)
Returns the value of attribute enabled
7 8 9 |
# File 'lib/html2rss/feed_resolution/options.rb', line 7 def enabled @enabled end |
#max_probes ⇒ Object (readonly)
Returns the value of attribute max_probes
7 8 9 |
# File 'lib/html2rss/feed_resolution/options.rb', line 7 def max_probes @max_probes end |
Class Method Details
.from_auto_source(auto_source) ⇒ Options
11 12 13 14 15 16 17 18 |
# File 'lib/html2rss/feed_resolution/options.rb', line 11 def self.from_auto_source(auto_source) raw = auto_source.is_a?(Hash) ? auto_source[:entry_resolution] : nil raw = {} unless raw.is_a?(Hash) new( enabled: raw.fetch(:enabled, FeedResolution::DEFAULT_CONFIG[:enabled]) != false, max_probes: Integer(raw.fetch(:max_probes, FeedResolution::DEFAULT_CONFIG[:max_probes])) ) end |
Instance Method Details
#enabled? ⇒ Boolean
22 |
# File 'lib/html2rss/feed_resolution/options.rb', line 22 def enabled? = enabled |
#request_slots ⇒ Integer
Probe slots plus one Orchestrator retry GET when enabled.
28 |
# File 'lib/html2rss/feed_resolution/options.rb', line 28 def request_slots = enabled? ? max_probes + 1 : 0 |