Class: ActionController::TestRequest
- Inherits:
-
Object
- Object
- ActionController::TestRequest
- Defined in:
- lib/oauth/client/action_controller_request.rb
Class Method Summary (collapse)
Instance Method Summary (collapse)
- - (Object) apply_oauth!
- - (Object) configure_oauth(consumer = nil, token = nil, options = {})
- - (Object) set_oauth_header
- - (Object) set_oauth_parameters
- - (Object) set_oauth_query_string
Class Method Details
+ (Object) use_oauth=(bool)
27 28 29 |
# File 'lib/oauth/client/action_controller_request.rb', line 27 def self.use_oauth=(bool) @use_oauth = bool end |
+ (Boolean) use_oauth?
31 32 33 |
# File 'lib/oauth/client/action_controller_request.rb', line 31 def self.use_oauth? @use_oauth end |
Instance Method Details
- (Object) apply_oauth!
44 45 46 47 48 49 50 51 |
# File 'lib/oauth/client/action_controller_request.rb', line 44 def apply_oauth! return unless ActionController::TestRequest.use_oauth? && @oauth_options @oauth_helper = OAuth::Client::Helper.new(self, @oauth_options.merge(:request_uri => (respond_to?(:fullpath) ? fullpath : request_uri))) @oauth_helper.amend_user_agent_header(env) self.send("set_oauth_#{@oauth_options[:scheme]}") end |
- (Object) configure_oauth(consumer = nil, token = nil, options = {})
35 36 37 38 39 40 41 42 |
# File 'lib/oauth/client/action_controller_request.rb', line 35 def configure_oauth(consumer = nil, token = nil, = {}) @oauth_options = { :consumer => consumer, :token => token, :scheme => 'header', :signature_method => nil, :nonce => nil, :timestamp => nil }.merge() end |
- (Object) set_oauth_header
53 54 55 |
# File 'lib/oauth/client/action_controller_request.rb', line 53 def set_oauth_header env['Authorization'] = @oauth_helper.header end |
- (Object) set_oauth_parameters
57 58 59 60 |
# File 'lib/oauth/client/action_controller_request.rb', line 57 def set_oauth_parameters @query_parameters = @oauth_helper.parameters_with_oauth @query_parameters.merge!(:oauth_signature => @oauth_helper.signature) end |
- (Object) set_oauth_query_string
62 63 |
# File 'lib/oauth/client/action_controller_request.rb', line 62 def set_oauth_query_string end |