Class: Authlogic::TestCase::MockRequest
- Inherits:
-
Object
- Object
- Authlogic::TestCase::MockRequest
- Defined in:
- lib/authlogic/test_case/mock_request.rb
Overview
:nodoc:
Instance Attribute Summary collapse
-
#controller ⇒ Object
Returns the value of attribute controller.
Instance Method Summary collapse
- #env ⇒ Object
- #format ⇒ Object
-
#initialize(controller) ⇒ MockRequest
constructor
A new instance of MockRequest.
- #ip ⇒ Object
Constructor Details
#initialize(controller) ⇒ MockRequest
Returns a new instance of MockRequest.
8 9 10 |
# File 'lib/authlogic/test_case/mock_request.rb', line 8 def initialize(controller) self.controller = controller end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(*args, &block) ⇒ Object (private)
31 32 |
# File 'lib/authlogic/test_case/mock_request.rb', line 31 def method_missing(*args, &block) end |
Instance Attribute Details
#controller ⇒ Object
Returns the value of attribute controller.
6 7 8 |
# File 'lib/authlogic/test_case/mock_request.rb', line 6 def controller @controller end |
Instance Method Details
#env ⇒ Object
12 13 14 15 16 |
# File 'lib/authlogic/test_case/mock_request.rb', line 12 def env @env ||= { ControllerAdapters::AbstractAdapter::ENV_SESSION_OPTIONS => {} } end |
#format ⇒ Object
18 19 20 |
# File 'lib/authlogic/test_case/mock_request.rb', line 18 def format controller.request_content_type if controller.respond_to? :request_content_type end |
#ip ⇒ Object
22 23 24 25 26 27 |
# File 'lib/authlogic/test_case/mock_request.rb', line 22 def ip controller&.respond_to?(:env) && controller.env.is_a?(Hash) && controller.env["REMOTE_ADDR"] || "1.1.1.1" end |