Sha256: 4044d144aed16207ac946e3ba8620afcef7acfd2e0ecc69923d513e418260f9a
Contents?: true
Size: 393 Bytes
Versions: 14
Compression:
Stored size: 393 Bytes
Contents
# frozen_string_literal: true module Uploadcare module Rails # A class extracting an ID of an object from an URL. class IdExtractor class << self # regex is an UUID-regex by default def call(input_str, regex = /\b[0-9a-f]{8}\b-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-\b[0-9a-f]{12}\b/) input_str.match(regex).to_s end end end end end
Version data entries
14 entries across 14 versions & 1 rubygems