Class: Html2rss::RequestService::Strategy
- Inherits:
-
Object
- Object
- Html2rss::RequestService::Strategy
- Defined in:
- lib/html2rss/request_service/strategy.rb
Overview
Defines the guarded request interface for every strategy adapter.
#execute always runs timeout check → budget/policy preflight → #fetch
→ ResponseGuard postflight so new adapters cannot skip shared controls.
Direct Known Subclasses
BotasaurusStrategy, BrowserlessStrategy, FaradayStrategy, LocalFileStrategy
Instance Method Summary collapse
-
#execute ⇒ Response
Executes the request through the shared preflight/postflight path.
-
#initialize(ctx) ⇒ Strategy
constructor
A new instance of Strategy.
Constructor Details
#initialize(ctx) ⇒ Strategy
Returns a new instance of Strategy.
13 14 15 |
# File 'lib/html2rss/request_service/strategy.rb', line 13 def initialize(ctx) @ctx = ctx end |
Instance Method Details
#execute ⇒ Response
Executes the request through the shared preflight/postflight path.
22 23 24 25 26 27 28 29 |
# File 'lib/html2rss/request_service/strategy.rb', line 22 def execute check_timeout! response = perform_execute postflight!(response, response_guard:) response rescue StandardError => error handle_error(error) end |