Sha256: 63486f19b41a6a4d3e48b1afe761314a986769fd031f8920b1442de1668d222d

Contents?: true

Size: 545 Bytes

Versions: 5

Compression:

Stored size: 545 Bytes

Contents

module Ezid
  #
  # A response to an EZID status request
  #
  # @see Ezid::Response
  # @api private
  #
  class Status < SimpleDelegator

    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

5 entries across 5 versions & 1 rubygems

Version Path
ezid-client-0.11.0 lib/ezid/status.rb
ezid-client-0.10.0 lib/ezid/status.rb
ezid-client-0.9.1 lib/ezid/status.rb
ezid-client-0.9.0 lib/ezid/status.rb
ezid-client-0.8.0 lib/ezid/status.rb