Class: OpenID::Consumer::DiscoveredServices
- Inherits:
-
Object
- Object
- OpenID::Consumer::DiscoveredServices
- Defined in:
- lib/openid/consumer/discovery_manager.rb
Overview
A set of discovered services, for tracking which providers have been attempted for an OpenID identifier
Instance Attribute Summary collapse
-
#current ⇒ Object
readonly
Returns the value of attribute current.
Instance Method Summary collapse
- #empty? ⇒ Boolean
- #for_url?(url) ⇒ Boolean
-
#initialize(starting_url, yadis_url, services) ⇒ DiscoveredServices
constructor
A new instance of DiscoveredServices.
- #next ⇒ Object
- #started? ⇒ Boolean
Constructor Details
#initialize(starting_url, yadis_url, services) ⇒ DiscoveredServices
Returns a new instance of DiscoveredServices.
9 10 11 12 13 14 |
# File 'lib/openid/consumer/discovery_manager.rb', line 9 def initialize(starting_url, yadis_url, services) @starting_url = starting_url @yadis_url = yadis_url @services = services.dup @current = nil end |
Instance Attribute Details
#current ⇒ Object (readonly)
Returns the value of attribute current.
7 8 9 |
# File 'lib/openid/consumer/discovery_manager.rb', line 7 def current @current end |
Instance Method Details
#empty? ⇒ Boolean
28 29 30 |
# File 'lib/openid/consumer/discovery_manager.rb', line 28 def empty? @services.empty? end |
#for_url?(url) ⇒ Boolean
20 21 22 |
# File 'lib/openid/consumer/discovery_manager.rb', line 20 def for_url?(url) [@starting_url, @yadis_url].member?(url) end |
#next ⇒ Object
16 17 18 |
# File 'lib/openid/consumer/discovery_manager.rb', line 16 def next @current = @services.shift end |
#started? ⇒ Boolean
24 25 26 |
# File 'lib/openid/consumer/discovery_manager.rb', line 24 def started? !@current.nil? end |