Class: Lame::Request
- Inherits:
-
Rack::Request
- Object
- Rack::Request
- Lame::Request
- Defined in:
- lib/main.rb
Instance Method Summary collapse
Instance Method Details
#params ⇒ Object
18 19 20 21 22 23 24 |
# File 'lib/main.rb', line 18 def params begin @params = @env["QUERY_STRING"].split('&').inject({}) {|h,(k,v) | h[k.split('=')[0].intern] = CGI.unescape(k.split('=')[1]); h} rescue @params = {} end end |
#uri ⇒ Object
10 11 12 13 14 15 16 |
# File 'lib/main.rb', line 10 def uri begin @uri = (@env["PATH_INFO"].split("/").collect {|r| r.intern unless r.empty?}).compact rescue NoMethodError @uri = {} end end |