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.



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

def provider_name
  @provider_name
end

Instance Method Details

#check_requirementsObject



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

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=



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

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=



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

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

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



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

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