~singpolyma/sgx-jmp

ref: 9440485fcd93b619a22e729cf591264b6569dcd4 sgx-jmp/lib/promise_hash.rb -rw-r--r-- 205 bytes
9440485fStephen Paul Weber Merge branch 'more-admin-info' a month ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
# frozen_string_literal: true

require "em_promise"

module PromiseHash
	def self.all(**kwargs)
		keys = kwargs.keys
		EMPromise.all(kwargs.values).then { |results|
			Hash[keys.zip(results)]
		}
	end
end