Sha256: 09a80bed12e0ff4820349138c106e33abdc6602c1f34d1ab825704165b41e3de

Contents?: true

Size: 809 Bytes

Versions: 5

Compression:

Stored size: 809 Bytes

Contents

require 'parliament'
require 'parliament/ntriple'

module Parliament
  module Utils
    module Helpers
      module ParliamentHelper
        def self.parliament_request(request_id = nil, request_number = 1)
          headers = {'Ocp-Apim-Subscription-Key' => ENV['PARLIAMENT_AUTH_TOKEN'] }
          headers['Request-Id'] = "#{request_id}#{request_number}" if request_id

          Parliament::Request::UrlRequest.new(
            builder:    Parliament::Builder::NTripleResponseBuilder,
            headers:    headers,
            decorators: Parliament::Grom::Decorator
          )
        end

        def parliament_request(request_id = nil, request_number = 1)
          Parliament::Utils::Helpers::ParliamentHelper.parliament_request(request_id, request_number)
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
parliament-utils-0.8.7 lib/parliament/utils/helpers/parliament_helper.rb
parliament-utils-0.8.6 lib/parliament/utils/helpers/parliament_helper.rb
parliament-utils-0.8.5 lib/parliament/utils/helpers/parliament_helper.rb
parliament-utils-0.8.4 lib/parliament/utils/helpers/parliament_helper.rb
parliament-utils-0.8.3 lib/parliament/utils/helpers/parliament_helper.rb