Class: Opi::Request
- Inherits:
-
Rack::Request
- Object
- Rack::Request
- Opi::Request
- Defined in:
- lib/opi/request.rb
Instance Method Summary collapse
- #accept ⇒ Object
- #method ⇒ Object
- #path ⇒ Object
- #path_components ⇒ Object
- #uri ⇒ Object
- #user_agent ⇒ Object
Instance Method Details
#accept ⇒ Object
8 9 10 |
# File 'lib/opi/request.rb', line 8 def accept @env['HTTP_ACCEPT'].to_s.split(',').map { |a| a.strip } end |
#method ⇒ Object
22 23 24 |
# File 'lib/opi/request.rb', line 22 def method @env['REQUEST_METHOD'] end |
#path ⇒ Object
12 13 14 15 16 |
# File 'lib/opi/request.rb', line 12 def path @path = @env["PATH_INFO"] @path = '/' if @path.nil? or @path.strip.empty? @path end |
#path_components ⇒ Object
26 27 28 |
# File 'lib/opi/request.rb', line 26 def path_components @path_components ||= path.split('/') end |
#uri ⇒ Object
18 19 20 |
# File 'lib/opi/request.rb', line 18 def uri @env["REQUEST_URI"] end |
#user_agent ⇒ Object
4 5 6 |
# File 'lib/opi/request.rb', line 4 def user_agent @env['HTTP_USER_AGENT'] end |