Sha256: 652a7c7dc6212dea8f536bc547f697ea31f8d3c49280782d62e50907364cd0ba

Contents?: true

Size: 553 Bytes

Versions: 24

Compression:

Stored size: 553 Bytes

Contents

require_relative "response"

module Ezid
  #
  # A response to an EZID status request
  # @api private
  #
  class ServerStatusResponse < Response

    SUBSYSTEMS = %w( noid ldap datacite )

    SUBSYSTEMS.each do |s|
      define_method(s) { subsystems[s] || "not checked" }
    end

    def subsystems
      return {} unless content[1]
      content[1].split(/\r?\n/).each_with_object({}) do |line, memo|
        subsystem, status = line.split(": ", 2)
        memo[subsystem] = status
      end
    end

    def up?
      success?
    end

  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
ezid-client-1.10.0 lib/ezid/responses/server_status_response.rb
ezid-client-1.9.4 lib/ezid/responses/server_status_response.rb
ezid-client-1.9.3 lib/ezid/responses/server_status_response.rb
ezid-client-1.9.2 lib/ezid/responses/server_status_response.rb
ezid-client-1.9.1 lib/ezid/responses/server_status_response.rb
ezid-client-1.9.0 lib/ezid/responses/server_status_response.rb
ezid-client-1.9.0.rc1 lib/ezid/responses/server_status_response.rb
ezid-client-1.8.0 lib/ezid/responses/server_status_response.rb
ezid-client-1.7.1 lib/ezid/responses/server_status_response.rb
ezid-client-1.7.0 lib/ezid/responses/server_status_response.rb
ezid-client-1.6.0 lib/ezid/responses/server_status_response.rb
ezid-client-1.5.0 lib/ezid/responses/server_status_response.rb
ezid-client-1.4.3 lib/ezid/responses/server_status_response.rb
ezid-client-1.4.2 lib/ezid/responses/server_status_response.rb
ezid-client-1.4.1 lib/ezid/responses/server_status_response.rb
ezid-client-1.4.0 lib/ezid/responses/server_status_response.rb
ezid-client-1.3.0 lib/ezid/responses/server_status_response.rb
ezid-client-1.2.0 lib/ezid/responses/server_status_response.rb
ezid-client-1.1.1 lib/ezid/responses/server_status_response.rb
ezid-client-1.1.0 lib/ezid/responses/server_status_response.rb