# frozen_string_literal: true require 'httparty' module NoradBeacon # Class to post results class NoradAPI include HTTParty @norad_root = ENV.fetch('NORAD_ROOT') def self.post_results(results) auth_header = { 'NORAD-SIGNATURE' => results.compute_signature } address = @norad_root + results.url post( address, body: results.payload, headers: { 'Content-Type' => 'application/json' }.merge(auth_header) ) end end end