Class ActionController::TestRequest
In: lib/oauth/client/action_controller_request.rb
Parent: Object

Methods

Public Class methods

[Source]

# File lib/oauth/client/action_controller_request.rb, line 16
    def self.use_oauth=(bool)
      @use_oauth = bool
    end

[Source]

# File lib/oauth/client/action_controller_request.rb, line 20
    def self.use_oauth?
      @use_oauth
    end

Public Instance methods

[Source]

# File lib/oauth/client/action_controller_request.rb, line 33
    def apply_oauth!
      return unless ActionController::TestRequest.use_oauth? && @oauth_options

      @oauth_helper = OAuth::Client::Helper.new(self, @oauth_options.merge(:request_uri => request_uri))
      @oauth_helper.amend_user_agent_header(env)

      self.send("set_oauth_#{@oauth_options[:scheme]}")
    end

[Source]

# File lib/oauth/client/action_controller_request.rb, line 24
    def configure_oauth(consumer = nil, token = nil, options = {})
      @oauth_options = { :consumer  => consumer,
                         :token     => token,
                         :scheme    => 'header',
                         :signature_method => nil,
                         :nonce     => nil,
                         :timestamp => nil }.merge(options)
    end

[Source]

# File lib/oauth/client/action_controller_request.rb, line 42
    def set_oauth_header
      env['Authorization'] = @oauth_helper.header
    end

[Source]

# File lib/oauth/client/action_controller_request.rb, line 46
    def set_oauth_parameters
      @query_parameters = @oauth_helper.parameters_with_oauth
      @query_parameters.merge!(:oauth_signature => @oauth_helper.signature)
    end

[Source]

# File lib/oauth/client/action_controller_request.rb, line 51
    def set_oauth_query_string
    end

[Validate]