Module: OpenID::AX
- Defined in:
- lib/openid/extensions/ax.rb
Defined Under Namespace
Classes: AXMessage, AttrInfo, Error, FetchRequest, FetchResponse, KeyValueMessage, StoreRequest, StoreResponse
Constant Summary collapse
- UNLIMITED_VALUES =
"unlimited"
- MINIMUM_SUPPORTED_ALIAS_LENGTH =
32
Class Method Summary collapse
-
.check_alias(name) ⇒ Object
check alias for invalid characters, raise AXError if found.
-
.to_type_uris(namespace_map, alias_list_s) ⇒ Object
Given a namespace mapping and a string containing a comma-separated list of namespace aliases, return a list of type URIs that correspond to those aliases.
Class Method Details
.check_alias(name) ⇒ Object
check alias for invalid characters, raise AXError if found
14 15 16 17 18 19 |
# File 'lib/openid/extensions/ax.rb', line 14 def self.check_alias(name) if name.match(/(,|\.)/) raise Error, ("Alias #{name.inspect} must not contain a "\ "comma or period.") end end |
.to_type_uris(namespace_map, alias_list_s) ⇒ Object
Given a namespace mapping and a string containing a comma-separated list of namespace aliases, return a list of type URIs that correspond to those aliases. namespace_map: OpenID::NamespaceMap
97 98 99 100 101 102 103 104 |
# File 'lib/openid/extensions/ax.rb', line 97 def self.to_type_uris(namespace_map, alias_list_s) return [] if alias_list_s.nil? alias_list_s.split(',').inject([]) {|uris, name| type_uri = namespace_map.get_namespace_uri(name) raise IndexError, "No type defined for attribute name #{name.inspect}" if type_uri.nil? uris << type_uri } end |