Class: UzuUzu::Request
- Defined in:
- lib/uzuuzu-core/request.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.current ⇒ Object
7 8 9 |
# File 'lib/uzuuzu-core/request.rb', line 7 def self.current Thread.current[:request] end |
Instance Method Details
#accept ⇒ Object
11 12 13 |
# File 'lib/uzuuzu-core/request.rb', line 11 def accept @env['HTTP_ACCEPT'].to_s.split(',').map { |a| a.split(';')[0].strip } end |
#domain(path = nil, options = {}) ⇒ Object
27 28 29 30 31 32 |
# File 'lib/uzuuzu-core/request.rb', line 27 def domain(path = nil, = {}) uri = URI(self.url) uri.path = path.to_s if path uri.query = nil unless [:keep_query] uri.to_s end |
#query_suffix ⇒ Object Also known as: wish
15 16 17 18 19 20 21 22 23 24 |
# File 'lib/uzuuzu-core/request.rb', line 15 def query_suffix return @query_suffix if @query_suffix if /^.+\.(.+?)$/ =~ self.path @query_suffix = $1.to_sym else @query_suffix = :html end @query_suffix = :xhr if @query_suffix == :html and self.xhr? @query_suffix end |