Class: Warden::OAuth::Config
- Inherits:
-
Object
- Object
- Warden::OAuth::Config
- Defined in:
- lib/warden_oauth/config.rb
Overview
Holds all the information of the OAuth service.
Instance Attribute Summary collapse
-
#provider_name ⇒ Object
Returns the value of attribute provider_name.
Instance Method Summary collapse
- #check_requirements ⇒ Object
- #consumer_key(key = nil) ⇒ Object (also: #consumer_key=)
- #consumer_secret(secret = nil) ⇒ Object (also: #consumer_secret=)
- #options(options = nil) ⇒ Object (also: #options=)
Instance Attribute Details
#provider_name ⇒ Object
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_requirements ⇒ Object
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 ( = nil) unless .nil? @options = end @options end |