Class: Crystal::DefaultFormatProcessor

Inherits:
Object
  • Object
show all
Defined in:
lib/crystal/router/default_format_processor.rb

Instance Method Summary collapse

Instance Method Details

#add_format(path, format) ⇒ Object



3
4
5
6
# File 'lib/crystal/router/default_format_processor.rb', line 3

def add_format path, format
  path << ".#{format}"
  path
end

#remove_format(path) ⇒ Object



8
9
10
# File 'lib/crystal/router/default_format_processor.rb', line 8

def remove_format path
  path.sub(/\.[^\.]+$/, '')
end