Class: OpenID::Consumer::DiscoveredServices

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

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

#currentObject (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

Returns:

  • (Boolean)


28
29
30
# File 'lib/openid/consumer/discovery_manager.rb', line 28

def empty?
  @services.empty?
end

#for_url?(url) ⇒ Boolean

Returns:

  • (Boolean)


20
21
22
# File 'lib/openid/consumer/discovery_manager.rb', line 20

def for_url?(url)
  [@starting_url, @yadis_url].member?(url)
end

#nextObject



16
17
18
# File 'lib/openid/consumer/discovery_manager.rb', line 16

def next
  @current = @services.shift
end

#started?Boolean

Returns:

  • (Boolean)


24
25
26
# File 'lib/openid/consumer/discovery_manager.rb', line 24

def started?
  !@current.nil?
end