Sha256: 647907f7657515efefc4e03e80e41f48e09e7ec597d4b33ca2a103daf6105685

Contents?: true

Size: 528 Bytes

Versions: 7

Compression:

Stored size: 528 Bytes

Contents

# frozen_string_literal: true

module HttpHealthCheck
  module Probe
    class Result
      def self.ok(meta)
        new(true, meta)
      end

      def self.error(meta)
        new(false, meta)
      end

      def initialize(is_ok, meta)
        @meta = Hash(meta)
        @ok = is_ok
      rescue StandardError => e
        e = ::HttpHealthCheck::ConfigurationError.new(e.message)
        e.set_backtrace(e.backtrace)
        raise e
      end
      attr_reader :meta

      def ok?
        @ok
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
http_health_check-0.5.0 lib/http_health_check/probe/result.rb
http_health_check-0.4.1 lib/http_health_check/probe/result.rb
http_health_check-0.4.0 lib/http_health_check/probe/result.rb
http_health_check-0.3.1 lib/http_health_check/probe/result.rb
http_health_check-0.3.0 lib/http_health_check/probe/result.rb
http_health_check-0.2.1 lib/http_health_check/probe/result.rb
http_health_check-0.2.0 lib/http_health_check/probe/result.rb