Sha256: a76d223fc60834b3abafde3cf7e944e69b0053a4e53e1fef333b1efb40a73a8b

Contents?: true

Size: 690 Bytes

Versions: 20

Compression:

Stored size: 690 Bytes

Contents

module Certmeister

  class Response

    private_class_method :new

    def initialize(type, pem, error)
      @type = type
      @pem = pem
      @error = error
    end

    def pem
      @pem
    end

    def error
      @error
    end

    def hit?
      @type == :hit
    end

    def miss?
      @type == :miss
    end

    def denied?
      @type == :denied
    end

    def error?
      @type == :error
    end

    def self.hit(pem = :none)
      new(:hit, pem, nil)
    end

    def self.miss
      new(:miss, nil, nil)
    end

    def self.denied(message)
      new(:denied, nil, message)
    end

    def self.error(message)
      new(:error, nil, message)
    end

  end

end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
certmeister-2.3.2 lib/certmeister/response.rb
certmeister-2.3.1 lib/certmeister/response.rb
certmeister-2.3.0 lib/certmeister/response.rb
certmeister-2.2.0 lib/certmeister/response.rb
certmeister-2.1.0 lib/certmeister/response.rb
certmeister-2.0.0 lib/certmeister/response.rb
certmeister-1.2.1 lib/certmeister/response.rb
certmeister-1.2.0 lib/certmeister/response.rb
certmeister-1.1.0 lib/certmeister/response.rb
certmeister-1.0.1 lib/certmeister/response.rb
certmeister-1.0.0 lib/certmeister/response.rb
certmeister-0.4.1 lib/certmeister/response.rb
certmeister-0.4.0 lib/certmeister/response.rb
certmeister-0.3.2 lib/certmeister/response.rb
certmeister-0.3.1 lib/certmeister/response.rb
certmeister-0.3.0 lib/certmeister/response.rb
certmeister-0.2.3 lib/certmeister/response.rb
certmeister-0.2.1 lib/certmeister/response.rb
certmeister-0.2.0 lib/certmeister/response.rb
certmeister-0.1.0 lib/certmeister/response.rb