Class: Ecfr::DiffService::Status

Inherits:
Base
  • Object
show all
Includes:
Ecfr::DefaultStatusSetup
Defined in:
lib/ecfr/diff_service/status.rb

Constant Summary collapse

STATUS_PATH =
"v1"

Class Method Summary collapse

Methods included from Ecfr::DefaultStatusSetup

included, #status_code

Methods inherited from Base

base_url, service_name, service_path

Class Method Details

.statusObject



8
9
10
11
12
13
14
15
# File 'lib/ecfr/diff_service/status.rb', line 8

def self.status
  perform(
    status_config[:method],
    STATUS_PATH,
    params: status_config[:options],
    perform_options: {parse_response: false}
  )
end

.status_configObject

.status_config is provided to support use cases in which the user wants to construct their own handling of status checks, e.g. to wrap in custom errors or run in parallel



21
22
23
24
25
26
27
28
29
30
31
# File 'lib/ecfr/diff_service/status.rb', line 21

def self.status_config
  {
    url: "#{base_url}/#{service_path}/#{STATUS_PATH}",
    method: :post,
    response_type: "html",
    options: {
      new: "old test",
      old: "new test"
    }
  }
end