Class: Html2rss::RequestService::Strategy

Inherits:
Object
  • Object
show all
Defined in:
lib/html2rss/request_service/strategy.rb

Overview

Defines the interface of every request strategy.

Direct Known Subclasses

BrowserlessStrategy, FaradayStrategy

Instance Method Summary collapse

Constructor Details

#initialize(ctx) ⇒ Strategy

Returns a new instance of Strategy.

Parameters:

  • ctx (Context)

    the context for the request



10
11
12
# File 'lib/html2rss/request_service/strategy.rb', line 10

def initialize(ctx)
  @ctx = ctx
end

Instance Method Details

#executeResponse

Executes the request.

Returns:

  • (Response)

    the response from the strategy

Raises:

  • (NotImplementedError)

    if the method is not implemented by the subclass



18
19
20
# File 'lib/html2rss/request_service/strategy.rb', line 18

def execute
  raise NotImplementedError, 'Subclass must implement #execute'
end