Class: Hackle::HttpWorkspaceFetcher

Inherits:
Object
  • Object
show all
Defined in:
lib/hackle/internal/workspace/http_workspace_fetcher.rb

Instance Method Summary collapse

Constructor Details

#initialize(http_client:, sdk:) ⇒ HttpWorkspaceFetcher

Returns a new instance of HttpWorkspaceFetcher.

Parameters:



11
12
13
14
15
16
17
18
19
20
21
# File 'lib/hackle/internal/workspace/http_workspace_fetcher.rb', line 11

def initialize(http_client:, sdk:)

  # @type [String]
  @url = "/api/v2/workspaces/#{sdk.key}/config"

  # @type [HttpClient]
  @http_client = http_client

  # @type [String, nil]
  @last_modified = nil
end

Instance Method Details

#fetch_if_modifiedHackle::Workspace?

Returns:



24
25
26
27
28
# File 'lib/hackle/internal/workspace/http_workspace_fetcher.rb', line 24

def fetch_if_modified
  request = create_request
  response = @http_client.execute(request)
  handle_response(response)
end