Sha256: 6c6d4a980e1820180ab5b6661b2426aaafab95ced2ed97eece1910c1dffecc3f

Contents?: true

Size: 452 Bytes

Versions: 3

Compression:

Stored size: 452 Bytes

Contents

module Ezid
  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

3 entries across 3 versions & 1 rubygems

Version Path
ezid-client-0.4.2 lib/ezid/status.rb
ezid-client-0.4.1 lib/ezid/status.rb
ezid-client-0.4.0 lib/ezid/status.rb