-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Dan Callaghan
committed
Aug 5, 2020
1 parent
c770e49
commit c55818c
Showing
3 changed files
with
63 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
require "json" | ||
|
||
module PassKit | ||
alias NFCTuple = NamedTuple(message: String) | | ||
NamedTuple(message: String, encryption_public_key: String?) | ||
|
||
struct NFC | ||
include JSON::Serializable | ||
|
||
property message : String | ||
|
||
@[JSON::Field(key: "encryptionPublicKey")] | ||
property encryption_public_key : String? | ||
|
||
def initialize(@message, @encryption_public_key = nil) | ||
end | ||
|
||
def initialize(attributes : NFCTuple) | ||
@message = attributes[:message] | ||
@encryption_public_key = attributes[:encryption_public_key]? | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters