Class: Authlogic::TestCase::MockRequest

Inherits:
Object
  • Object
show all
Defined in:
lib/authlogic/test_case/mock_request.rb

Overview

:nodoc:

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Constructor Details

- (MockRequest) initialize(controller)



6
7
8
# File 'lib/authlogic/test_case/mock_request.rb', line 6

def initialize(controller)
  self.controller = controller
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

- (Object) method_missing(*args, &block) (private)



15
16
# File 'lib/authlogic/test_case/mock_request.rb', line 15

def method_missing(*args, &block)
end

Instance Attribute Details

- (Object) controller

Returns the value of attribute controller



4
5
6
# File 'lib/authlogic/test_case/mock_request.rb', line 4

def controller
  @controller
end

Instance Method Details

- (Object) ip



10
11
12
# File 'lib/authlogic/test_case/mock_request.rb', line 10

def ip
  (controller && controller.respond_to?(:env) && controller.env.is_a?(Hash) && controller.env['REMOTE_ADDR']) || "1.1.1.1"
end