Module: Ki::Middleware::Helpers::FormatOf

Included in:
BaseRequest
Defined in:
lib/ki/middleware/helpers/format_of_helper.rb

Instance Method Summary collapse

Instance Method Details

#format_of(uri) ⇒ Object



5
6
7
8
9
10
# File 'lib/ki/middleware/helpers/format_of_helper.rb', line 5

def format_of(uri)
  uri = uri.path if uri.class == BaseRequest
  File.extname(URI.parse(uri).path).gsub('.', '')
rescue URI::InvalidURIError
  ''
end