Module: DIDKit::Services
- Included in:
- Document, PLCOperation
- Defined in:
- lib/didkit/services.rb
Instance Method Summary collapse
- #get_service(key, type) ⇒ Object
- #labeler_endpoint ⇒ Object (also: #labeller_endpoint)
- #labeler_host ⇒ Object (also: #labeller_host)
- #pds_endpoint ⇒ Object
- #pds_host ⇒ Object
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_endpoint ⇒ Object 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_host ⇒ Object 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_endpoint ⇒ Object
9 10 11 |
# File 'lib/didkit/services.rb', line 9 def pds_endpoint @pds_endpoint ||= get_service('atproto_pds', 'AtprotoPersonalDataServer')&.endpoint end |
#pds_host ⇒ Object
17 18 19 |
# File 'lib/didkit/services.rb', line 17 def pds_host pds_endpoint&.then { |x| URI(x).host } end |