Module: DIDKit::Services

Included in:
Document, PLCOperation
Defined in:
lib/didkit/services.rb

Instance Method Summary collapse

Instance Method Details

#get_service(key, type) ⇒ Object



5
6
7
# File 'lib/didkit/services.rb', line 5

def get_service(key, type)
  @services&.detect { |s| s.key == key && s.type == type }
end

#labeler_endpointObject Also known as: labeller_endpoint



13
14
15
# File 'lib/didkit/services.rb', line 13

def labeler_endpoint
  @labeler_endpoint ||= get_service('atproto_labeler', 'AtprotoLabeler')&.endpoint
end

#labeler_hostObject Also known as: labeller_host



21
22
23
# File 'lib/didkit/services.rb', line 21

def labeler_host
  labeler_endpoint&.then { |x| URI(x).host }
end

#pds_endpointObject



9
10
11
# File 'lib/didkit/services.rb', line 9

def pds_endpoint
  @pds_endpoint ||= get_service('atproto_pds', 'AtprotoPersonalDataServer')&.endpoint
end

#pds_hostObject



17
18
19
# File 'lib/didkit/services.rb', line 17

def pds_host
  pds_endpoint&.then { |x| URI(x).host }
end