Sha256: 74332d9a0b6d525e42253595a4548eab91ebdf96564e2bd8c1de0be7d2d7569b

Contents?: true

Size: 416 Bytes

Versions: 1

Compression:

Stored size: 416 Bytes

Contents

module PGit
  class PivotalRequestValidator
    attr_reader :request

    def initialize(request)
      @request = request

      validate
    end

    private

    def validate
      if kind_error? || no_kind?
        raise PGit::Error::External.new(@request)
      end
    end

    def kind_error?
      @request.match(/"kind": "error"/)
    end

    def no_kind?
      !@request.match(/"kind"/)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
pgit-1.0.0 lib/pgit/pivotal_request_validator.rb