Class: OpenID::Yadis::DiscoveryResult

Inherits:
Object
  • Object
show all
Defined in:
lib/openid/yadis/discovery.rb

Overview

Contains the result of performing Yadis discovery on a URI

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(request_uri) ⇒ DiscoveryResult

Returns a new instance of DiscoveryResult.



40
41
42
43
44
45
46
47
48
49
# File 'lib/openid/yadis/discovery.rb', line 40

def initialize(request_uri)
  # Initialize the state of the object
  #
  # sets all attributes to None except the request_uri
  @request_uri = request_uri
  @normalized_uri = nil
  @xrds_uri = nil
  @content_type = nil
  @response_text = nil
end

Instance Attribute Details

#content_typeObject

The content-type returned with the response_text



33
34
35
# File 'lib/openid/yadis/discovery.rb', line 33

def content_type
  @content_type
end

#normalize_uriObject

The result of following redirects from the request_uri



26
27
28
# File 'lib/openid/yadis/discovery.rb', line 26

def normalize_uri
  @normalize_uri
end

#normalized_uriObject

Returns the value of attribute normalized_uri.



38
39
40
# File 'lib/openid/yadis/discovery.rb', line 38

def normalized_uri
  @normalized_uri
end

#request_uriObject

Returns the value of attribute request_uri.



38
39
40
# File 'lib/openid/yadis/discovery.rb', line 38

def request_uri
  @request_uri
end

#response_textObject

The document returned from the xrds_uri



36
37
38
# File 'lib/openid/yadis/discovery.rb', line 36

def response_text
  @response_text
end

#xrds_uriObject

The URI from which the response text was returned (set to nil if there was no XRDS document found)



30
31
32
# File 'lib/openid/yadis/discovery.rb', line 30

def xrds_uri
  @xrds_uri
end

Instance Method Details

#is_xrdsObject

Is the response text supposed to be an XRDS document?



57
58
59
60
# File 'lib/openid/yadis/discovery.rb', line 57

def is_xrds
  return (used_yadis_location?() or
          @content_type == YADIS_CONTENT_TYPE)
end

#used_yadis_location?Boolean

Was the Yadis protocol’s indirection used?

Returns:

  • (Boolean)


52
53
54
# File 'lib/openid/yadis/discovery.rb', line 52

def used_yadis_location?
  return @normalized_uri != @xrds_uri
end