Class: Warden::OAuth::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/warden_oauth/config.rb

Overview

Holds all the information of the OAuth service.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#provider_nameObject

Returns the value of attribute provider_name.



7
8
9
# File 'lib/warden_oauth/config.rb', line 7

def provider_name
  @provider_name
end

Instance Method Details

#check_requirementsObject



33
34
35
36
37
# File 'lib/warden_oauth/config.rb', line 33

def check_requirements
  if @consumer_key.nil? || @consumer_secret.nil?
    raise Warden::OAuth::ConfigError.new("You need to specify the consumer key and the consumer secret")
  end
end

#consumer_key(key = nil) ⇒ Object Also known as: consumer_key=



9
10
11
12
13
14
# File 'lib/warden_oauth/config.rb', line 9

def consumer_key(key = nil)
  unless key.nil?
    @consumer_key = key
  end
  @consumer_key
end

#consumer_secret(secret = nil) ⇒ Object Also known as: consumer_secret=



17
18
19
20
21
22
# File 'lib/warden_oauth/config.rb', line 17

def consumer_secret(secret = nil)
  unless secret.nil?
    @consumer_secret = secret
  end
  @consumer_secret
end

#options(options = nil) ⇒ Object Also known as: options=



25
26
27
28
29
30
# File 'lib/warden_oauth/config.rb', line 25

def options(options = nil)
  unless options.nil?
    @options = options
  end
  @options
end