Class: Optimum::PathSanitizer

Inherits:
Object
  • Object
show all
Defined in:
lib/optimum/path_sanitizer.rb

Class Method Summary collapse

Class Method Details

.sanitize(path) ⇒ Object

Removes any leading ‘/’



6
7
8
9
# File 'lib/optimum/path_sanitizer.rb', line 6

def self.sanitize(path)
  parts = path.split('/').reject(&:empty?)
  parts.join('/')
end