class Dugway::Request
Public Instance Methods
extension()
click to toggle source
# File lib/dugway/request.rb, line 20 def extension File.extname(path).present? ? File.extname(path) : '.html' end
format()
click to toggle source
# File lib/dugway/request.rb, line 24 def format params[:format] || extension[1..-1] end
html?()
click to toggle source
# File lib/dugway/request.rb, line 28 def html? format == 'html' end
js?()
click to toggle source
# File lib/dugway/request.rb, line 32 def js? format == 'js' end
page_permalink()
click to toggle source
# File lib/dugway/request.rb, line 7 def page_permalink case path when %r{^/$} 'home' when %r{^/(products|category|artist)/} 'products' when %r{^/product/} 'product' else File.basename(path[1..-1], '.*') end end
params()
click to toggle source
Calls superclass method
# File lib/dugway/request.rb, line 3 def params super.update(env['rack.routing_args']).symbolize_keys end