tangled
alpha
login
or
join now
mackuba.eu
/
didkit
1
fork
atom
A library for handling DID identifiers used in Bluesky AT Protocol
1
fork
atom
overview
issues
pulls
pipelines
expose cid property on PLCOperation
mackuba.eu
2 years ago
3ee0c437
456b4818
+5
-1
1 changed file
expand all
collapse all
unified
split
lib
didkit
plc_operation.rb
+5
-1
lib/didkit/plc_operation.rb
···
12
12
include AtHandles
13
13
include Services
14
14
15
15
-
attr_reader :json, :did, :created_at, :type, :handles, :services
15
15
+
attr_reader :json, :did, :cid, :created_at, :type, :handles, :services
16
16
17
17
def initialize(json)
18
18
@json = json
19
19
@did = json['did']
20
20
raise FormatError, "Missing DID: #{json}" if @did.nil?
21
21
raise FormatError, "Invalid DID: #{@did}" unless @did.is_a?(String) && @did.start_with?('did:')
22
22
+
23
23
+
@cid = json['cid']
24
24
+
raise FormatError, "Missing CID: #{json}" if @cid.nil?
25
25
+
raise FormatError, "Invalid CID: #{@cid}" unless @cid.is_a?(String)
22
26
23
27
timestamp = json['createdAt']
24
28
raise FormatError, "Missing createdAt: #{json}" if timestamp.nil?