Class: Rambo::ApplicationRequest

Inherits:
Request
  • Object
show all
Defined in:
lib/rambo/application_request.rb

Instance Method Summary collapse

Methods inherited from Request

#accept, #application_context, #application_context=, #default_controller, #params, #path, #path_components, #uri, #user_agent

Constructor Details

#initialize(env) ⇒ ApplicationRequest

Returns a new instance of ApplicationRequest.



4
5
6
# File 'lib/rambo/application_request.rb', line 4

def initialize(env)
  super
end

Instance Method Details

#actionObject



16
17
18
# File 'lib/rambo/application_request.rb', line 16

def action
  path_components[3] || 'index'
end

#applicationObject



8
9
10
# File 'lib/rambo/application_request.rb', line 8

def application
  path_components[1]
end

#controllerObject



12
13
14
# File 'lib/rambo/application_request.rb', line 12

def controller
  path_components[2] || default_controller
end

#controller_classObject



20
21
22
# File 'lib/rambo/application_request.rb', line 20

def controller_class
  self.application.gsub(/^[a-z]|\s+[a-z]/) { |a| a.upcase } + '::' + super
end