Class: DHS::Endpoint

Inherits:
Object
  • Object
show all
Defined in:
lib/dhs/endpoint.rb

Overview

An endpoint is used as source to fetch objects

Class Method Summary collapse

Class Method Details

.for_url(url) ⇒ Object



6
7
8
9
10
11
# File 'lib/dhs/endpoint.rb', line 6

def self.for_url(url)
  template, record = DHS::Record::Endpoints.all.dup.detect do |template, _record|
    DHC::Endpoint.match?(url, template)
  end
  record&.endpoints&.detect { |endpoint| endpoint.url == template }
end