Class: OAuth2::Strategy::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/oauth2/strategy/base.rb

Overview

:nodoc:

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ Base

:nodoc:



4
5
6
# File 'lib/oauth2/strategy/base.rb', line 4

def initialize(client)#:nodoc:
  @client = client
end

Instance Method Details

#access_token_params(options = {}) ⇒ Object



21
22
23
24
25
26
# File 'lib/oauth2/strategy/base.rb', line 21

def access_token_params(options = {})
  {
    'client_id' => @client.id,
    'client_secret' => @client.secret
  }.merge(options)
end

#access_token_url(options = {}) ⇒ Object



17
18
19
# File 'lib/oauth2/strategy/base.rb', line 17

def access_token_url(options = {})
  @client.access_token_url(access_token_params(options))
end

#authorize_params(options = {}) ⇒ Object

:nodoc:



12
13
14
15
# File 'lib/oauth2/strategy/base.rb', line 12

def authorize_params(options = {}) #:nodoc:
  options = options.inject({}){|h, (k, v)| h[k.to_s] = v; h}
  {'client_id' => @client.id}.merge(options)
end

#authorize_url(options = {}) ⇒ Object

:nodoc:



8
9
10
# File 'lib/oauth2/strategy/base.rb', line 8

def authorize_url(options = {}) #:nodoc:
  @client.authorize_url(authorize_params(options))
end