Module: HealthCards::Importer
- Defined in:
- lib/health_cards/importer.rb
Overview
Converts a JWS to formats needed by endpoints (e.g. $issue-health-card, download and qr code)
Class Method Summary collapse
-
.scan(qr_contents) ⇒ Hash
Scan QR code.
-
.upload(jws_string) ⇒ Array<Hash>
Import JWS from file upload.
Class Method Details
.scan(qr_contents) ⇒ Hash
Scan QR code
20 21 22 23 |
# File 'lib/health_cards/importer.rb', line 20 def self.scan(qr_contents) qr_codes = QRCodes.new(qr_contents) verify_jws qr_codes.to_jws end |
.upload(jws_string) ⇒ Array<Hash>
Import JWS from file upload
9 10 11 12 13 14 15 |
# File 'lib/health_cards/importer.rb', line 9 def self.upload(jws_string) vc = JSON.parse(jws_string) vc_jws = vc['verifiableCredential'] vc_jws.map do |j| verify_jws j end end |