Class: OpenID::Consumer::DiscoveryManager
- Inherits:
-
Object
- Object
- OpenID::Consumer::DiscoveryManager
- Defined in:
- lib/openid/consumer/discovery_manager.rb
Overview
Manages calling discovery and tracking which endpoints have already been attempted.
Instance Method Summary collapse
- #cleanup(force = false) ⇒ Object
- #get_next_service ⇒ Object
-
#initialize(session, url, session_key_suffix = nil) ⇒ DiscoveryManager
constructor
A new instance of DiscoveryManager.
Constructor Details
#initialize(session, url, session_key_suffix = nil) ⇒ DiscoveryManager
Returns a new instance of DiscoveryManager.
36 37 38 39 40 41 |
# File 'lib/openid/consumer/discovery_manager.rb', line 36 def initialize(session, url, session_key_suffix=nil) @url = url @session = session @session_key_suffix = session_key_suffix || 'auth' end |
Instance Method Details
#cleanup(force = false) ⇒ Object
65 66 67 68 69 70 71 72 73 74 |
# File 'lib/openid/consumer/discovery_manager.rb', line 65 def cleanup(force=false) manager = get_manager(force) if !manager.nil? service = manager.current destroy_manager(force) else service = nil end return service end |
#get_next_service ⇒ Object
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 |
# File 'lib/openid/consumer/discovery_manager.rb', line 43 def get_next_service manager = get_manager if !manager.nil? && manager.empty? destroy_manager manager = nil end if manager.nil? yadis_url, services = yield @url manager = create_manager(yadis_url, services) end if !manager.nil? service = manager.next store(manager) else service = nil end return service end |