Class: Optimum::PathSanitizer
- Inherits:
-
Object
- Object
- Optimum::PathSanitizer
- Defined in:
- lib/optimum/path_sanitizer.rb
Class Method Summary collapse
-
.sanitize(path) ⇒ Object
Removes any leading ‘/’.
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 |