Class: OpenID::Consumer::DiscoveredServices

### Home Classes Methods

### In Files

- lib/openid/consumer/discovery_manager.rb

### Parent

Object

### Methods

- ::from_session_value
- ::new
- #==
- #empty?
- #for_url?
- #next
- #started?
- #to_session_value

### Files

- LICENSE

### Class/Module Index

Quicksearch

- OpenID
- OpenID::AX
- OpenID::AX::AXMessage
- OpenID::AX::AttrInfo
- OpenID::AX::Error
- OpenID::AX::FetchRequest
- OpenID::AX::FetchResponse
- OpenID::AX::KeyValueMessage
- OpenID::AX::StoreRequest
- OpenID::AX::StoreResponse
- OpenID::AssertionError
- OpenID::Association
- OpenID::AssociationNegotiator
- OpenID::Consumer
- OpenID::Consumer::AssociationManager
- OpenID::Consumer::CancelResponse
- OpenID::Consumer::CheckIDRequest
- OpenID::Consumer::DiffieHellmanSHA1Session
- OpenID::Consumer::DiffieHellmanSHA256Session
- OpenID::Consumer::DiffieHellmanSession
- OpenID::Consumer::DiscoveredServices
- OpenID::Consumer::DiscoveryManager
- OpenID::Consumer::FailureResponse
- OpenID::Consumer::IdResHandler
- OpenID::Consumer::NoEncryptionSession
- OpenID::Consumer::Response
- OpenID::Consumer::Session
- OpenID::Consumer::SetupNeededResponse
- OpenID::Consumer::SuccessResponse
- OpenID::CryptUtil
- OpenID::DiffieHellman
- OpenID::DiscoveryFailure
- OpenID::Extension
- OpenID::FetchingError
- OpenID::HTTPRedirectLimitReached
- OpenID::HTTPResponse
- OpenID::HTTPStatusError
- OpenID::InvalidOpenIDNamespace
- OpenID::KVFormError
- OpenID::KVPostNetworkError
- OpenID::Message
- OpenID::Message::KeyNotFound
- OpenID::NamespaceAliasRegistrationError
- OpenID::NamespaceMap
- OpenID::Nonce
- OpenID::OAuth
- OpenID::OAuth::Request
- OpenID::OAuth::Response
- OpenID::OpenIDError
- OpenID::OpenIDServiceEndpoint
- OpenID::PAPE
- OpenID::PAPE::Request
- OpenID::PAPE::Response
- OpenID::ProtocolError
- OpenID::RealmVerificationRedirected
- OpenID::SReg
- OpenID::SReg::NamespaceError
- OpenID::SReg::Request
- OpenID::SReg::Response
- OpenID::SSLFetchingError
- OpenID::Server
- OpenID::Server::AlreadySigned
- OpenID::Server::AssociateRequest
- OpenID::Server::BaseServerSession
- OpenID::Server::CheckAuthRequest
- OpenID::Server::CheckIDRequest
- OpenID::Server::Decoder
- OpenID::Server::DiffieHellmanSHA1ServerSession
- OpenID::Server::DiffieHellmanSHA256ServerSession
- OpenID::Server::Encoder
- OpenID::Server::EncodingError
- OpenID::Server::MalformedReturnURL
- OpenID::Server::MalformedTrustRoot
- OpenID::Server::NoReturnToError
- OpenID::Server::OpenIDRequest
- OpenID::Server::OpenIDResponse
- OpenID::Server::PlainTextServerSession
- OpenID::Server::ProtocolError
- OpenID::Server::Server
- OpenID::Server::Signatory
- OpenID::Server::SigningEncoder
- OpenID::Server::UntrustedReturnURL
- OpenID::Server::VersionError
- OpenID::Server::WebResponse
- OpenID::ServerError
- OpenID::StandardFetcher
- OpenID::Store
- OpenID::Store::Filesystem
- OpenID::Store::Interface
- OpenID::Store::Memcache
- OpenID::Store::Memory
- OpenID::TrustRoot
- OpenID::TrustRoot::TrustRoot
- OpenID::TypeURIMismatch
- OpenID::UI
- OpenID::UI::Request
- OpenID::URINorm
- OpenID::UndefinedOpenIDNamespace
- OpenID::Util
- OpenID::Yadis
- OpenID::Yadis::BasicServiceEndpoint
- OpenID::Yadis::CompoundFilter
- OpenID::Yadis::DiscoveryResult
- OpenID::Yadis::TransformFilterMaker
- OpenID::Yadis::XRDSError
- OpenID::Yadis::XRDSFraud
- OpenID::Yadis::XRI
- OpenID::Yadis::XRI::ProxyResolver
- OpenID::Yadis::XRI::XRIHTTPError
- HMAC
- HMAC::Base
- HMAC::SHA1
- HMAC::SHA256
- HMAC::SHA384
- HMAC::SHA512
- Net
- Net::HTTP
- HTMLComment
- HTMLTag
- HTMLText
- HTMLToken
- HTMLTokenizer
- HTMLTokenizerError
- Object

No matching classes.

# OpenID::Consumer::DiscoveredServices

A set of discovered services, for tracking which providers have been attempted for an OpenID identifier

### Attributes

current[R]

### Public Class Methods

from_session_value(value) click to toggle source

    # File lib/openid/consumer/discovery_manager.rb, line 48
    def self.from_session_value(value)
      return value unless value.is_a?(Hash)

      services = value['services'].map{|s| OpenID::OpenIDServiceEndpoint.from_session_value(s) }
      current = OpenID::OpenIDServiceEndpoint.from_session_value(value['current'])

      obj = self.new(value['starting_url'], value['yadis_url'], services)
      obj.instance_variable_set("@current", current)
      obj
    end

new(starting_url, yadis_url, services) click to toggle source

    # 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

### Public Instance Methods

==(other) click to toggle source

    # File lib/openid/consumer/discovery_manager.rb, line 44
    def ==(other)
      to_session_value == other.to_session_value
    end

empty?() click to toggle source

    # File lib/openid/consumer/discovery_manager.rb, line 28
    def empty?
      @services.empty?
    end

for_url?(url) click to toggle source

    # File lib/openid/consumer/discovery_manager.rb, line 20
    def for_url?(url)
      [@starting_url, @yadis_url].member?(url)
    end

next() click to toggle source

    # File lib/openid/consumer/discovery_manager.rb, line 16
    def next
      @current = @services.shift
    end

started?() click to toggle source

    # File lib/openid/consumer/discovery_manager.rb, line 24
    def started?
      !@current.nil?
    end

to_session_value() click to toggle source

    # File lib/openid/consumer/discovery_manager.rb, line 32
    def to_session_value
      services = @services.map{|s| s.respond_to?(:to_session_value) ? s.to_session_value : s }
      current_val = @current.respond_to?(:to_session_value) ? @current.to_session_value : @current

      {
        'starting_url' => @starting_url,
        'yadis_url' => @yadis_url,
        'services' => services,
        'current' => current_val
      }
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.