Class: Opi::Request

Inherits:
Rack::Request
  • Object
show all
Defined in:
lib/opi/request.rb

Instance Method Summary collapse

Instance Method Details

#acceptObject



8
9
10
# File 'lib/opi/request.rb', line 8

def accept
  @env['HTTP_ACCEPT'].to_s.split(',').map { |a| a.strip }
end

#methodObject



22
23
24
# File 'lib/opi/request.rb', line 22

def method
  @env['REQUEST_METHOD']
end

#pathObject



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_componentsObject



26
27
28
# File 'lib/opi/request.rb', line 26

def path_components
  @path_components ||= path.split('/')
end

#uriObject



18
19
20
# File 'lib/opi/request.rb', line 18

def uri
  @env["REQUEST_URI"]
end

#user_agentObject



4
5
6
# File 'lib/opi/request.rb', line 4

def user_agent
  @env['HTTP_USER_AGENT']
end