Class: OpenAuth2::Config
- Inherits:
-
Object
- Object
- OpenAuth2::Config
- Defined in:
- lib/open_auth2/config.rb
Overview
Holds the info required to make a valid request to an OAuth server.
Instance Attribute Summary collapse
-
#provider ⇒ Object
Returns the value of attribute provider.
-
#provider_const ⇒ Object
readonly
Returns the value of attribute provider_const.
-
#provider_string ⇒ Object
readonly
Returns the value of attribute provider_string.
Instance Method Summary collapse
-
#configure {|_self| ... } ⇒ Object
Yields: self, use it to set/change config after #initialize.
-
#initialize {|_self| ... } ⇒ Config
constructor
Sets provider to default.
- #parse(response_body) ⇒ Object
-
#reset_provider ⇒ Object
Removes all overwritten config & resets provider to default.
Constructor Details
#initialize {|_self| ... } ⇒ Config
19 20 21 22 23 |
# File 'lib/open_auth2/config.rb', line 19 def initialize set_default_as_provider yield self if block_given? end |
Instance Attribute Details
#provider ⇒ Object
Returns the value of attribute provider.
6 7 8 |
# File 'lib/open_auth2/config.rb', line 6 def provider @provider end |
#provider_const ⇒ Object (readonly)
Returns the value of attribute provider_const.
6 7 8 |
# File 'lib/open_auth2/config.rb', line 6 def provider_const @provider_const end |
#provider_string ⇒ Object (readonly)
Returns the value of attribute provider_string.
6 7 8 |
# File 'lib/open_auth2/config.rb', line 6 def provider_string @provider_string end |
Instance Method Details
#configure {|_self| ... } ⇒ Object
36 37 38 |
# File 'lib/open_auth2/config.rb', line 36 def configure yield self if block_given? end |
#parse(response_body) ⇒ Object
56 57 58 |
# File 'lib/open_auth2/config.rb', line 56 def parse(response_body) @provider_const.parse(self, response_body) end |
#reset_provider ⇒ Object
Removes all overwritten config & resets provider to default.
51 52 53 54 |
# File 'lib/open_auth2/config.rb', line 51 def reset_provider remove_instance_vars set_default_as_provider end |