Class: OpenID::Extension
- Inherits:
-
Object
- Object
- OpenID::Extension
- Defined in:
- lib/openid/extension.rb
Overview
An interface for OpenID extensions.
Direct Known Subclasses
AX::AXMessage, OAuth::Request, OAuth::Response, PAPE::Request, PAPE::Response, SReg::Request, SReg::Response
Instance Method Summary collapse
-
#get_extension_args ⇒ Object
Get the string arguments that should be added to an OpenID message for this extension.
-
#initialize ⇒ Extension
constructor
A new instance of Extension.
-
#to_message(message = nil) ⇒ Object
Add the arguments from this extension to the provided message, or create a new message containing only those arguments.
Constructor Details
#initialize ⇒ Extension
Returns a new instance of Extension.
7 8 9 10 |
# File 'lib/openid/extension.rb', line 7 def initialize @ns_uri = nil @ns_alias = nil end |
Instance Method Details
#get_extension_args ⇒ Object
Get the string arguments that should be added to an OpenID message for this extension.
14 15 16 |
# File 'lib/openid/extension.rb', line 14 def get_extension_args raise NotImplementedError end |
#to_message(message = nil) ⇒ Object
Add the arguments from this extension to the provided message, or create a new message containing only those arguments. Returns the message with added extension args.
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/openid/extension.rb', line 21 def ( = nil) if .nil? # warnings.warn('Passing None to Extension.toMessage is deprecated. ' # 'Creating a message assuming you want OpenID 2.', # DeprecationWarning, stacklevel=2) Message.new(OPENID2_NS) end = Message.new if .nil? implicit = .is_openid1() .namespaces.add_alias(@ns_uri, @ns_alias, implicit) # XXX python ignores keyerror if m.ns.getAlias(uri) == alias .update_args(@ns_uri, get_extension_args) return end |