Module: Yoda::Server::UriDecoder

Defined in:
lib/yoda/server/uri_decoder.rb

Class Method Summary collapse

Class Method Details

.path_of_uri(uri_string) ⇒ String?

Parameters:

  • uri_string (String)

Returns:

  • (String, nil)


7
8
9
10
11
12
13
# File 'lib/yoda/server/uri_decoder.rb', line 7

def self.path_of_uri(uri_string)
  uri = URI.parse(uri_string)
  return nil unless uri.scheme == 'file'
  uri.path
rescue URI::InvalidURIError
  nil
end