Class: Uploadcare::Rails::Internal::IdExtractor

Inherits:
Object
  • Object
show all
Defined in:
lib/uploadcare/rails/internal/id_extractor.rb

Constant Summary collapse

UUID_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/

Class Method Summary collapse

Class Method Details

.call(input_str, regex = UUID_REGEX) ⇒ Object



10
11
12
13
14
# File 'lib/uploadcare/rails/internal/id_extractor.rb', line 10

def call(input_str, regex = UUID_REGEX)
  return unless input_str.present?

  input_str.match(regex).to_s
end