File: M000461.html

package info (click to toggle)
libopenid-ruby 2.1.2debian-1
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 5,140 kB
  • ctags: 3,251
  • sloc: ruby: 17,165; xml: 219; sh: 54; python: 30; makefile: 12
file content (32 lines) | stat: -rw-r--r-- 2,512 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html 
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html>
<head>
  <title>to_message (OpenID::Extension)</title>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
</head>
<body class="standalone-code">
  <pre><span class="ruby-comment cmt"># File lib/openid/extension.rb, line 21</span>
    <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_message</span>(<span class="ruby-identifier">message</span> = <span class="ruby-keyword kw">nil</span>)
      <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">message</span>.<span class="ruby-identifier">nil?</span>
<span class="ruby-comment cmt">#         warnings.warn('Passing None to Extension.toMessage is deprecated. '</span>
<span class="ruby-comment cmt">#                       'Creating a message assuming you want OpenID 2.',</span>
<span class="ruby-comment cmt">#                       DeprecationWarning, stacklevel=2)</span>
        <span class="ruby-constant">Message</span>.<span class="ruby-identifier">new</span>(<span class="ruby-constant">OPENID2_NS</span>)
      <span class="ruby-keyword kw">end</span>
      <span class="ruby-identifier">message</span> = <span class="ruby-constant">Message</span>.<span class="ruby-identifier">new</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">message</span>.<span class="ruby-identifier">nil?</span>

      <span class="ruby-identifier">implicit</span> = <span class="ruby-identifier">message</span>.<span class="ruby-identifier">is_openid1</span>()

      <span class="ruby-identifier">message</span>.<span class="ruby-identifier">namespaces</span>.<span class="ruby-identifier">add_alias</span>(<span class="ruby-ivar">@ns_uri</span>, <span class="ruby-ivar">@ns_alias</span>, <span class="ruby-identifier">implicit</span>)
      <span class="ruby-comment cmt"># XXX python ignores keyerror if m.ns.getAlias(uri) == alias</span>

      <span class="ruby-identifier">message</span>.<span class="ruby-identifier">update_args</span>(<span class="ruby-ivar">@ns_uri</span>, <span class="ruby-identifier">get_extension_args</span>)
      <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">message</span>
    <span class="ruby-keyword kw">end</span></pre>
</body>
</html>