Method: Proton::Page#default_ext

Defined in:
lib/proton/page.rb

#default_extObject

Attribute: default_ext (Proton::Page) Returns a default extension for the page based on the page’s MIME type.

## Example

Page['/style.css'].default_ext    #=> 'css'
Page['/index.html'].default_ext   #=> 'html'

## See also

- {Proton::Page::mime_type}


237
238
239
240
241
242
243
244
# File 'lib/proton/page.rb', line 237

def default_ext
  case mime_type
  when 'text/html' then 'html'
  when 'text/css' then 'css'
  when 'text/xml' then 'xml'
  when 'application/javascript' then 'js'
  end
end