Method: LHS::Endpoint.for_url

Defined in:
lib/lhs/endpoint.rb

.for_url(url) ⇒ Object



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

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