Class: Ecfr::DiffService::Status

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

Constant Summary collapse

STATUS_PATH =
"v1"

Constants inherited from Base

Base::SUPPORTED_ARRAY_ACCESSORS

Instance Attribute Summary

Attributes inherited from Base

#metadata, #request_data, #response_status, #results

Class Method Summary collapse

Methods included from Ecfr::DefaultStatusSetup

included, #status_code

Methods inherited from Base

base_url, service_name, service_path

Methods inherited from Base

basic_auth_client_options, #each, #initialize, metadata, metadata_key, result_key

Methods included from Extensible

#inherited

Methods included from AttributeMethodDefinition

included, #initialize

Methods inherited from Client

build, cache_key, client, client_pool, delete, execute, get, handle_response, perform, post, purge

Methods included from ParallelClient

included

Constructor Details

This class inherits a constructor from Ecfr::Base

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