simplemapper 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (150) hide show
  1. data/LICENSE +1 -1
  2. data/README +16 -0
  3. data/Rakefile +1 -1
  4. data/doc/classes/Array.html +24 -5
  5. data/doc/classes/{Inflector.src/M000017.html → Array.src/M000005.html} +4 -8
  6. data/doc/classes/Array.src/{M000001.html → M000006.html} +1 -1
  7. data/doc/classes/Callbacks.html +15 -15
  8. data/doc/classes/Callbacks.src/{M000037.html → M000040.html} +0 -0
  9. data/doc/classes/Callbacks.src/{M000038.html → M000041.html} +0 -0
  10. data/doc/classes/Callbacks.src/{M000039.html → M000042.html} +0 -0
  11. data/doc/classes/Enumerable.html +5 -5
  12. data/doc/classes/Enumerable.src/{M000040.html → M000043.html} +1 -1
  13. data/doc/classes/Hash.html +23 -4
  14. data/doc/classes/Hash.src/M000002.html +6 -4
  15. data/doc/classes/Hash.src/M000003.html +4 -20
  16. data/doc/classes/Hash.src/M000004.html +34 -0
  17. data/doc/classes/Inflector/Inflections.html +40 -40
  18. data/doc/classes/Inflector/Inflections.src/M000034.html +4 -5
  19. data/doc/classes/Inflector/Inflections.src/M000035.html +4 -4
  20. data/doc/classes/Inflector/Inflections.src/M000036.html +4 -9
  21. data/doc/classes/Inflector/Inflections.src/M000037.html +19 -0
  22. data/doc/classes/Inflector/Inflections.src/{M000031.html → M000038.html} +4 -4
  23. data/doc/classes/Inflector/Inflections.src/M000039.html +23 -0
  24. data/doc/classes/Inflector.html +82 -82
  25. data/doc/classes/Inflector.src/M000020.html +6 -6
  26. data/doc/classes/Inflector.src/M000021.html +11 -4
  27. data/doc/classes/Inflector.src/M000022.html +11 -8
  28. data/doc/classes/Inflector.src/M000023.html +8 -4
  29. data/doc/classes/Inflector.src/M000024.html +4 -4
  30. data/doc/classes/Inflector.src/M000025.html +8 -4
  31. data/doc/classes/Inflector.src/M000026.html +4 -4
  32. data/doc/classes/Inflector.src/M000027.html +4 -5
  33. data/doc/classes/Inflector.src/M000028.html +4 -4
  34. data/doc/classes/Inflector.src/M000029.html +4 -8
  35. data/doc/classes/Inflector.src/M000030.html +5 -13
  36. data/doc/classes/Inflector.src/M000031.html +18 -0
  37. data/doc/classes/Inflector.src/M000032.html +22 -0
  38. data/doc/classes/Inflector.src/M000033.html +27 -0
  39. data/doc/classes/Merb/Request.html +5 -5
  40. data/doc/classes/Merb/Request.src/{M000041.html → M000044.html} +1 -1
  41. data/doc/classes/OAuth/RequestProxy/Base.html +5 -5
  42. data/doc/classes/OAuth/RequestProxy/Base.src/{M000012.html → M000015.html} +1 -1
  43. data/doc/classes/OAuth/Signature/Base.html +5 -5
  44. data/doc/classes/OAuth/Signature/Base.src/{M000011.html → M000014.html} +1 -1
  45. data/doc/classes/OAuthController.html +25 -25
  46. data/doc/classes/OAuthController.src/M000008.html +8 -11
  47. data/doc/classes/OAuthController.src/M000009.html +4 -5
  48. data/doc/classes/OAuthController.src/{M000007.html → M000010.html} +1 -1
  49. data/doc/classes/OAuthController.src/M000011.html +25 -0
  50. data/doc/classes/OAuthController.src/M000012.html +19 -0
  51. data/doc/classes/Object.html +18 -6
  52. data/doc/classes/Object.src/{M000010.html → M000013.html} +2 -2
  53. data/doc/classes/Proc.html +5 -5
  54. data/doc/classes/Proc.src/{M000004.html → M000007.html} +0 -0
  55. data/doc/classes/Serialize.html +20 -20
  56. data/doc/classes/Serialize.src/M000016.html +7 -32
  57. data/doc/classes/Serialize.src/{M000014.html → M000017.html} +1 -1
  58. data/doc/classes/Serialize.src/{M000015.html → M000018.html} +1 -1
  59. data/doc/classes/Serialize.src/M000019.html +18 -0
  60. data/doc/classes/SimpleMapper/Base.html +149 -124
  61. data/doc/classes/SimpleMapper/Base.src/M000067.html +3 -8
  62. data/doc/classes/SimpleMapper/Base.src/M000068.html +3 -13
  63. data/doc/classes/SimpleMapper/Base.src/M000069.html +4 -4
  64. data/doc/classes/SimpleMapper/Base.src/M000070.html +15 -4
  65. data/doc/classes/SimpleMapper/Base.src/M000071.html +7 -4
  66. data/doc/classes/SimpleMapper/Base.src/M000072.html +4 -5
  67. data/doc/classes/SimpleMapper/Base.src/M000073.html +12 -9
  68. data/doc/classes/SimpleMapper/Base.src/M000074.html +8 -5
  69. data/doc/classes/SimpleMapper/Base.src/M000075.html +5 -7
  70. data/doc/classes/SimpleMapper/Base.src/M000076.html +5 -5
  71. data/doc/classes/SimpleMapper/Base.src/M000077.html +6 -5
  72. data/doc/classes/SimpleMapper/Base.src/M000078.html +10 -6
  73. data/doc/classes/SimpleMapper/Base.src/M000079.html +4 -4
  74. data/doc/classes/SimpleMapper/Base.src/M000080.html +6 -4
  75. data/doc/classes/SimpleMapper/Base.src/M000081.html +4 -5
  76. data/doc/classes/SimpleMapper/Base.src/M000082.html +4 -6
  77. data/doc/classes/SimpleMapper/Base.src/M000083.html +5 -10
  78. data/doc/classes/SimpleMapper/Base.src/M000084.html +4 -4
  79. data/doc/classes/SimpleMapper/{HttpAdapter.src/M000057.html → Base.src/M000085.html} +4 -4
  80. data/doc/classes/SimpleMapper/Base.src/M000086.html +19 -0
  81. data/doc/classes/SimpleMapper/Base.src/M000087.html +20 -0
  82. data/doc/classes/SimpleMapper/Base.src/M000088.html +24 -0
  83. data/doc/classes/SimpleMapper/Base.src/M000089.html +18 -0
  84. data/doc/classes/SimpleMapper/HttpAdapter.html +40 -40
  85. data/doc/classes/SimpleMapper/HttpAdapter.src/{M000056.html → M000059.html} +1 -1
  86. data/doc/classes/SimpleMapper/HttpAdapter.src/M000060.html +4 -4
  87. data/doc/classes/SimpleMapper/HttpAdapter.src/M000061.html +5 -4
  88. data/doc/classes/SimpleMapper/HttpAdapter.src/M000063.html +5 -4
  89. data/doc/classes/SimpleMapper/HttpAdapter.src/M000064.html +18 -0
  90. data/doc/classes/SimpleMapper/HttpAdapter.src/{M000062.html → M000065.html} +1 -1
  91. data/doc/classes/SimpleMapper/HttpAdapter.src/M000066.html +18 -0
  92. data/doc/classes/SimpleMapper/HttpOAuthExtension.html +22 -22
  93. data/doc/classes/SimpleMapper/HttpOAuthExtension.src/M000051.html +27 -4
  94. data/doc/classes/SimpleMapper/HttpOAuthExtension.src/{M000049.html → M000052.html} +1 -3
  95. data/doc/classes/SimpleMapper/HttpOAuthExtension.src/{M000050.html → M000053.html} +1 -1
  96. data/doc/classes/SimpleMapper/HttpOAuthExtension.src/M000054.html +24 -0
  97. data/doc/classes/SimpleMapper/SimpleModel/ClassMethods.html +10 -10
  98. data/doc/classes/SimpleMapper/SimpleModel/ClassMethods.src/{M000046.html → M000049.html} +0 -0
  99. data/doc/classes/SimpleMapper/SimpleModel/ClassMethods.src/{M000047.html → M000050.html} +0 -0
  100. data/doc/classes/SimpleMapper/SimpleModel.html +20 -20
  101. data/doc/classes/SimpleMapper/SimpleModel.src/M000045.html +4 -10
  102. data/doc/classes/SimpleMapper/SimpleModel.src/{M000043.html → M000046.html} +0 -0
  103. data/doc/classes/SimpleMapper/SimpleModel.src/{M000044.html → M000047.html} +0 -0
  104. data/doc/classes/SimpleMapper/SimpleModel.src/M000048.html +24 -0
  105. data/doc/classes/SimpleMapper/XmlFormat/ClassMethods.html +5 -5
  106. data/doc/classes/SimpleMapper/XmlFormat/ClassMethods.src/{M000055.html → M000058.html} +5 -3
  107. data/doc/classes/SimpleMapper/XmlFormat.html +15 -15
  108. data/doc/classes/SimpleMapper/XmlFormat.src/{M000052.html → M000055.html} +1 -1
  109. data/doc/classes/SimpleMapper/XmlFormat.src/{M000053.html → M000056.html} +1 -1
  110. data/doc/classes/SimpleMapper/XmlFormat.src/{M000054.html → M000057.html} +4 -2
  111. data/doc/classes/Time.html +139 -0
  112. data/doc/classes/{OAuthController.src/M000006.html → Time.src/M000001.html} +4 -4
  113. data/doc/created.rid +1 -1
  114. data/doc/files/lib/simple_mapper/adapters/http_adapter_rb.html +2 -1
  115. data/doc/files/lib/simple_mapper/base_rb.html +1 -1
  116. data/doc/files/lib/simple_mapper/default_plugins/callbacks_rb.html +1 -1
  117. data/doc/files/lib/simple_mapper/default_plugins/oauth_rb.html +1 -7
  118. data/doc/files/lib/simple_mapper/default_plugins/options_to_query_rb.html +116 -0
  119. data/doc/files/lib/simple_mapper/default_plugins/simple_model_rb.html +1 -1
  120. data/doc/files/lib/simple_mapper/formats/xml_format_rb.html +3 -1
  121. data/doc/files/lib/simple_mapper/support/bliss_serializer_rb.html +2 -1
  122. data/doc/files/lib/simple_mapper/support/core_ext_rb.html +1 -1
  123. data/doc/files/lib/simple_mapper/support/inflections_rb.html +1 -1
  124. data/doc/files/lib/simple_mapper/support/inflector_rb.html +1 -1
  125. data/doc/files/lib/simple_mapper/support_rb.html +1 -1
  126. data/doc/files/lib/simple_mapper_rb.html +1 -1
  127. data/doc/fr_class_index.html +1 -0
  128. data/doc/fr_file_index.html +1 -0
  129. data/doc/fr_method_index.html +89 -84
  130. data/lib/simple_mapper/adapters/http_adapter.rb +4 -2
  131. data/lib/simple_mapper/base.rb +46 -23
  132. data/lib/simple_mapper/default_plugins/oauth.rb +3 -6
  133. data/lib/simple_mapper/default_plugins/options_to_query.rb +31 -0
  134. data/lib/simple_mapper/formats/xml_format.rb +10 -3
  135. data/lib/simple_mapper/support/bliss_serializer.rb +3 -113
  136. data/lib/simple_mapper/support/core_ext.rb +6 -2
  137. data/lib/simple_mapper/support/inflections.rb +1 -1
  138. metadata +52 -43
  139. data/doc/classes/Inflector/Inflections.src/M000032.html +0 -18
  140. data/doc/classes/Inflector/Inflections.src/M000033.html +0 -18
  141. data/doc/classes/Inflector.src/M000018.html +0 -25
  142. data/doc/classes/Inflector.src/M000019.html +0 -25
  143. data/doc/classes/OAuthController.src/M000005.html +0 -22
  144. data/doc/classes/Serialize.src/M000013.html +0 -21
  145. data/doc/classes/SimpleMapper/Base.src/M000064.html +0 -16
  146. data/doc/classes/SimpleMapper/Base.src/M000065.html +0 -16
  147. data/doc/classes/SimpleMapper/Base.src/M000066.html +0 -22
  148. data/doc/classes/SimpleMapper/HttpAdapter.src/M000058.html +0 -19
  149. data/doc/classes/SimpleMapper/HttpOAuthExtension.src/M000048.html +0 -49
  150. data/doc/classes/SimpleMapper/SimpleModel.src/M000042.html +0 -18
@@ -5,14 +5,18 @@
5
5
 
6
6
  <html>
7
7
  <head>
8
- <title>demodulize (Inflector)</title>
8
+ <title>underscore (Inflector)</title>
9
9
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
10
  <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
11
11
  </head>
12
12
  <body class="standalone-code">
13
- <pre><span class="ruby-comment cmt"># File lib/simple_mapper/support/inflector.rb, line 199</span>
14
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">demodulize</span>(<span class="ruby-identifier">class_name_in_module</span>)
15
- <span class="ruby-identifier">class_name_in_module</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-regexp re">/^.*::/</span>, <span class="ruby-value str">''</span>)
13
+ <pre><span class="ruby-comment cmt"># File lib/simple_mapper/support/inflector.rb, line 168</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">underscore</span>(<span class="ruby-identifier">camel_cased_word</span>)
15
+ <span class="ruby-identifier">camel_cased_word</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-regexp re">/::/</span>, <span class="ruby-value str">'/'</span>).
16
+ <span class="ruby-identifier">gsub</span>(<span class="ruby-regexp re">/([A-Z]+)([A-Z][a-z])/</span>,<span class="ruby-value str">'\1_\2'</span>).
17
+ <span class="ruby-identifier">gsub</span>(<span class="ruby-regexp re">/([a-z\d])([A-Z])/</span>,<span class="ruby-value str">'\1_\2'</span>).
18
+ <span class="ruby-identifier">tr</span>(<span class="ruby-value str">&quot;-&quot;</span>, <span class="ruby-value str">&quot;_&quot;</span>).
19
+ <span class="ruby-identifier">downcase</span>
16
20
  <span class="ruby-keyword kw">end</span></pre>
17
21
  </body>
18
22
  </html>
@@ -5,14 +5,14 @@
5
5
 
6
6
  <html>
7
7
  <head>
8
- <title>tableize (Inflector)</title>
8
+ <title>dasherize (Inflector)</title>
9
9
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
10
  <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
11
11
  </head>
12
12
  <body class="standalone-code">
13
- <pre><span class="ruby-comment cmt"># File lib/simple_mapper/support/inflector.rb, line 210</span>
14
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">tableize</span>(<span class="ruby-identifier">class_name</span>)
15
- <span class="ruby-identifier">pluralize</span>(<span class="ruby-identifier">underscore</span>(<span class="ruby-identifier">class_name</span>))
13
+ <pre><span class="ruby-comment cmt"># File lib/simple_mapper/support/inflector.rb, line 180</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">dasherize</span>(<span class="ruby-identifier">underscored_word</span>)
15
+ <span class="ruby-identifier">underscored_word</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-regexp re">/_/</span>, <span class="ruby-value str">'-'</span>)
16
16
  <span class="ruby-keyword kw">end</span></pre>
17
17
  </body>
18
18
  </html>
@@ -5,15 +5,14 @@
5
5
 
6
6
  <html>
7
7
  <head>
8
- <title>classify (Inflector)</title>
8
+ <title>humanize (Inflector)</title>
9
9
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
10
  <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
11
11
  </head>
12
12
  <body class="standalone-code">
13
- <pre><span class="ruby-comment cmt"># File lib/simple_mapper/support/inflector.rb, line 221</span>
14
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">classify</span>(<span class="ruby-identifier">table_name</span>)
15
- <span class="ruby-comment cmt"># strip out any leading schema name</span>
16
- <span class="ruby-identifier">camelize</span>(<span class="ruby-identifier">singularize</span>(<span class="ruby-identifier">table_name</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">sub</span>(<span class="ruby-regexp re">/.*\./</span>, <span class="ruby-value str">''</span>)))
13
+ <pre><span class="ruby-comment cmt"># File lib/simple_mapper/support/inflector.rb, line 190</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">humanize</span>(<span class="ruby-identifier">lower_case_and_underscored_word</span>)
15
+ <span class="ruby-identifier">lower_case_and_underscored_word</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-regexp re">/_id$/</span>, <span class="ruby-value str">&quot;&quot;</span>).<span class="ruby-identifier">gsub</span>(<span class="ruby-regexp re">/_/</span>, <span class="ruby-value str">&quot; &quot;</span>).<span class="ruby-identifier">capitalize</span>
17
16
  <span class="ruby-keyword kw">end</span></pre>
18
17
  </body>
19
18
  </html>
@@ -5,14 +5,14 @@
5
5
 
6
6
  <html>
7
7
  <head>
8
- <title>foreign_key (Inflector)</title>
8
+ <title>demodulize (Inflector)</title>
9
9
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
10
  <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
11
11
  </head>
12
12
  <body class="standalone-code">
13
- <pre><span class="ruby-comment cmt"># File lib/simple_mapper/support/inflector.rb, line 234</span>
14
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">foreign_key</span>(<span class="ruby-identifier">class_name</span>, <span class="ruby-identifier">separate_class_name_and_id_with_underscore</span> = <span class="ruby-keyword kw">true</span>)
15
- <span class="ruby-identifier">underscore</span>(<span class="ruby-identifier">demodulize</span>(<span class="ruby-identifier">class_name</span>)) <span class="ruby-operator">+</span> (<span class="ruby-identifier">separate_class_name_and_id_with_underscore</span> <span class="ruby-value">? </span><span class="ruby-value str">&quot;_id&quot;</span> <span class="ruby-operator">:</span> <span class="ruby-value str">&quot;id&quot;</span>)
13
+ <pre><span class="ruby-comment cmt"># File lib/simple_mapper/support/inflector.rb, line 199</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">demodulize</span>(<span class="ruby-identifier">class_name_in_module</span>)
15
+ <span class="ruby-identifier">class_name_in_module</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-regexp re">/^.*::/</span>, <span class="ruby-value str">''</span>)
16
16
  <span class="ruby-keyword kw">end</span></pre>
17
17
  </body>
18
18
  </html>
@@ -5,18 +5,14 @@
5
5
 
6
6
  <html>
7
7
  <head>
8
- <title>constantize (Inflector)</title>
8
+ <title>tableize (Inflector)</title>
9
9
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
10
  <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
11
11
  </head>
12
12
  <body class="standalone-code">
13
- <pre><span class="ruby-comment cmt"># File lib/simple_mapper/support/inflector.rb, line 245</span>
14
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">constantize</span>(<span class="ruby-identifier">camel_cased_word</span>)
15
- <span class="ruby-keyword kw">unless</span> <span class="ruby-regexp re">/\A(?:::)?([A-Z]\w*(?:::[A-Z]\w*)*)\z/</span> <span class="ruby-operator">=~</span> <span class="ruby-identifier">camel_cased_word</span>
16
- <span class="ruby-identifier">raise</span> <span class="ruby-constant">NameError</span>, <span class="ruby-node">&quot;#{camel_cased_word.inspect} is not a valid constant name!&quot;</span>
17
- <span class="ruby-keyword kw">end</span>
18
-
19
- <span class="ruby-constant">Object</span>.<span class="ruby-identifier">module_eval</span>(<span class="ruby-node">&quot;::#{$1}&quot;</span>, <span class="ruby-keyword kw">__FILE__</span>, <span class="ruby-keyword kw">__LINE__</span>)
13
+ <pre><span class="ruby-comment cmt"># File lib/simple_mapper/support/inflector.rb, line 210</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">tableize</span>(<span class="ruby-identifier">class_name</span>)
15
+ <span class="ruby-identifier">pluralize</span>(<span class="ruby-identifier">underscore</span>(<span class="ruby-identifier">class_name</span>))
20
16
  <span class="ruby-keyword kw">end</span></pre>
21
17
  </body>
22
18
  </html>
@@ -5,23 +5,15 @@
5
5
 
6
6
  <html>
7
7
  <head>
8
- <title>ordinalize (Inflector)</title>
8
+ <title>classify (Inflector)</title>
9
9
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
10
  <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
11
11
  </head>
12
12
  <body class="standalone-code">
13
- <pre><span class="ruby-comment cmt"># File lib/simple_mapper/support/inflector.rb, line 261</span>
14
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">ordinalize</span>(<span class="ruby-identifier">number</span>)
15
- <span class="ruby-keyword kw">if</span> (<span class="ruby-value">11</span><span class="ruby-operator">..</span><span class="ruby-value">13</span>).<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">number</span>.<span class="ruby-identifier">to_i</span> <span class="ruby-operator">%</span> <span class="ruby-value">100</span>)
16
- <span class="ruby-node">&quot;#{number}th&quot;</span>
17
- <span class="ruby-keyword kw">else</span>
18
- <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">number</span>.<span class="ruby-identifier">to_i</span> <span class="ruby-operator">%</span> <span class="ruby-value">10</span>
19
- <span class="ruby-keyword kw">when</span> <span class="ruby-value">1</span><span class="ruby-operator">:</span> <span class="ruby-node">&quot;#{number}st&quot;</span>
20
- <span class="ruby-keyword kw">when</span> <span class="ruby-value">2</span><span class="ruby-operator">:</span> <span class="ruby-node">&quot;#{number}nd&quot;</span>
21
- <span class="ruby-keyword kw">when</span> <span class="ruby-value">3</span><span class="ruby-operator">:</span> <span class="ruby-node">&quot;#{number}rd&quot;</span>
22
- <span class="ruby-keyword kw">else</span> <span class="ruby-node">&quot;#{number}th&quot;</span>
23
- <span class="ruby-keyword kw">end</span>
24
- <span class="ruby-keyword kw">end</span>
13
+ <pre><span class="ruby-comment cmt"># File lib/simple_mapper/support/inflector.rb, line 221</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">classify</span>(<span class="ruby-identifier">table_name</span>)
15
+ <span class="ruby-comment cmt"># strip out any leading schema name</span>
16
+ <span class="ruby-identifier">camelize</span>(<span class="ruby-identifier">singularize</span>(<span class="ruby-identifier">table_name</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">sub</span>(<span class="ruby-regexp re">/.*\./</span>, <span class="ruby-value str">''</span>)))
25
17
  <span class="ruby-keyword kw">end</span></pre>
26
18
  </body>
27
19
  </html>
@@ -0,0 +1,18 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>foreign_key (Inflector)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre><span class="ruby-comment cmt"># File lib/simple_mapper/support/inflector.rb, line 234</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">foreign_key</span>(<span class="ruby-identifier">class_name</span>, <span class="ruby-identifier">separate_class_name_and_id_with_underscore</span> = <span class="ruby-keyword kw">true</span>)
15
+ <span class="ruby-identifier">underscore</span>(<span class="ruby-identifier">demodulize</span>(<span class="ruby-identifier">class_name</span>)) <span class="ruby-operator">+</span> (<span class="ruby-identifier">separate_class_name_and_id_with_underscore</span> <span class="ruby-value">? </span><span class="ruby-value str">&quot;_id&quot;</span> <span class="ruby-operator">:</span> <span class="ruby-value str">&quot;id&quot;</span>)
16
+ <span class="ruby-keyword kw">end</span></pre>
17
+ </body>
18
+ </html>
@@ -0,0 +1,22 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>constantize (Inflector)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre><span class="ruby-comment cmt"># File lib/simple_mapper/support/inflector.rb, line 245</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">constantize</span>(<span class="ruby-identifier">camel_cased_word</span>)
15
+ <span class="ruby-keyword kw">unless</span> <span class="ruby-regexp re">/\A(?:::)?([A-Z]\w*(?:::[A-Z]\w*)*)\z/</span> <span class="ruby-operator">=~</span> <span class="ruby-identifier">camel_cased_word</span>
16
+ <span class="ruby-identifier">raise</span> <span class="ruby-constant">NameError</span>, <span class="ruby-node">&quot;#{camel_cased_word.inspect} is not a valid constant name!&quot;</span>
17
+ <span class="ruby-keyword kw">end</span>
18
+
19
+ <span class="ruby-constant">Object</span>.<span class="ruby-identifier">module_eval</span>(<span class="ruby-node">&quot;::#{$1}&quot;</span>, <span class="ruby-keyword kw">__FILE__</span>, <span class="ruby-keyword kw">__LINE__</span>)
20
+ <span class="ruby-keyword kw">end</span></pre>
21
+ </body>
22
+ </html>
@@ -0,0 +1,27 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>ordinalize (Inflector)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre><span class="ruby-comment cmt"># File lib/simple_mapper/support/inflector.rb, line 261</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">ordinalize</span>(<span class="ruby-identifier">number</span>)
15
+ <span class="ruby-keyword kw">if</span> (<span class="ruby-value">11</span><span class="ruby-operator">..</span><span class="ruby-value">13</span>).<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">number</span>.<span class="ruby-identifier">to_i</span> <span class="ruby-operator">%</span> <span class="ruby-value">100</span>)
16
+ <span class="ruby-node">&quot;#{number}th&quot;</span>
17
+ <span class="ruby-keyword kw">else</span>
18
+ <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">number</span>.<span class="ruby-identifier">to_i</span> <span class="ruby-operator">%</span> <span class="ruby-value">10</span>
19
+ <span class="ruby-keyword kw">when</span> <span class="ruby-value">1</span><span class="ruby-operator">:</span> <span class="ruby-node">&quot;#{number}st&quot;</span>
20
+ <span class="ruby-keyword kw">when</span> <span class="ruby-value">2</span><span class="ruby-operator">:</span> <span class="ruby-node">&quot;#{number}nd&quot;</span>
21
+ <span class="ruby-keyword kw">when</span> <span class="ruby-value">3</span><span class="ruby-operator">:</span> <span class="ruby-node">&quot;#{number}rd&quot;</span>
22
+ <span class="ruby-keyword kw">else</span> <span class="ruby-node">&quot;#{number}th&quot;</span>
23
+ <span class="ruby-keyword kw">end</span>
24
+ <span class="ruby-keyword kw">end</span>
25
+ <span class="ruby-keyword kw">end</span></pre>
26
+ </body>
27
+ </html>
@@ -88,7 +88,7 @@
88
88
  <h3 class="section-bar">Methods</h3>
89
89
 
90
90
  <div class="name-list">
91
- <a href="#M000041">xml_params</a>&nbsp;&nbsp;
91
+ <a href="#M000044">xml_params</a>&nbsp;&nbsp;
92
92
  </div>
93
93
  </div>
94
94
 
@@ -110,12 +110,12 @@
110
110
  <div id="methods">
111
111
  <h3 class="section-bar">Public Instance methods</h3>
112
112
 
113
- <div id="method-M000041" class="method-detail">
114
- <a name="M000041"></a>
113
+ <div id="method-M000044" class="method-detail">
114
+ <a name="M000044"></a>
115
115
 
116
116
  <div class="method-heading">
117
- <a href="Request.src/M000041.html" target="Code" class="method-signature"
118
- onclick="popupCode('Request.src/M000041.html');return false;">
117
+ <a href="Request.src/M000044.html" target="Code" class="method-signature"
118
+ onclick="popupCode('Request.src/M000044.html');return false;">
119
119
  <span class="method-name">xml_params</span><span class="method-args">()</span>
120
120
  </a>
121
121
  </div>
@@ -10,7 +10,7 @@
10
10
  <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
11
11
  </head>
12
12
  <body class="standalone-code">
13
- <pre><span class="ruby-comment cmt"># File lib/simple_mapper/support/bliss_serializer.rb, line 160</span>
13
+ <pre><span class="ruby-comment cmt"># File lib/simple_mapper/support/bliss_serializer.rb, line 50</span>
14
14
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">xml_params</span>
15
15
  <span class="ruby-ivar">@xml_params</span> <span class="ruby-operator">||=</span> <span class="ruby-keyword kw">begin</span>
16
16
  <span class="ruby-keyword kw">if</span> <span class="ruby-constant">Merb</span><span class="ruby-operator">::</span><span class="ruby-constant">Const</span><span class="ruby-operator">::</span><span class="ruby-constant">XML_MIME_TYPE_REGEXP</span>.<span class="ruby-identifier">match</span>(<span class="ruby-identifier">content_type</span>)
@@ -88,7 +88,7 @@
88
88
  <h3 class="section-bar">Methods</h3>
89
89
 
90
90
  <div class="name-list">
91
- <a href="#M000012">inspect</a>&nbsp;&nbsp;
91
+ <a href="#M000015">inspect</a>&nbsp;&nbsp;
92
92
  </div>
93
93
  </div>
94
94
 
@@ -110,12 +110,12 @@
110
110
  <div id="methods">
111
111
  <h3 class="section-bar">Public Instance methods</h3>
112
112
 
113
- <div id="method-M000012" class="method-detail">
114
- <a name="M000012"></a>
113
+ <div id="method-M000015" class="method-detail">
114
+ <a name="M000015"></a>
115
115
 
116
116
  <div class="method-heading">
117
- <a href="Base.src/M000012.html" target="Code" class="method-signature"
118
- onclick="popupCode('Base.src/M000012.html');return false;">
117
+ <a href="Base.src/M000015.html" target="Code" class="method-signature"
118
+ onclick="popupCode('Base.src/M000015.html');return false;">
119
119
  <span class="method-name">inspect</span><span class="method-args">()</span>
120
120
  </a>
121
121
  </div>
@@ -10,7 +10,7 @@
10
10
  <link rel="stylesheet" href="../../../.././rdoc-style.css" type="text/css" media="screen" />
11
11
  </head>
12
12
  <body class="standalone-code">
13
- <pre><span class="ruby-comment cmt"># File lib/simple_mapper/default_plugins/oauth.rb, line 24</span>
13
+ <pre><span class="ruby-comment cmt"># File lib/simple_mapper/default_plugins/oauth.rb, line 23</span>
14
14
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">inspect</span>
15
15
  <span class="ruby-node">&quot;#&lt;OAuth::RequestProxy::MerbRequest:#{object_id}\n\tconsumer_key: #{consumer_key}\n\ttoken: #{token}\n\tparameters: #{parameters.inspect}\n&gt;&quot;</span>
16
16
  <span class="ruby-keyword kw">end</span></pre>
@@ -88,7 +88,7 @@
88
88
  <h3 class="section-bar">Methods</h3>
89
89
 
90
90
  <div class="name-list">
91
- <a href="#M000011">new</a>&nbsp;&nbsp;
91
+ <a href="#M000014">new</a>&nbsp;&nbsp;
92
92
  </div>
93
93
  </div>
94
94
 
@@ -110,12 +110,12 @@
110
110
  <div id="methods">
111
111
  <h3 class="section-bar">Public Class methods</h3>
112
112
 
113
- <div id="method-M000011" class="method-detail">
114
- <a name="M000011"></a>
113
+ <div id="method-M000014" class="method-detail">
114
+ <a name="M000014"></a>
115
115
 
116
116
  <div class="method-heading">
117
- <a href="Base.src/M000011.html" target="Code" class="method-signature"
118
- onclick="popupCode('Base.src/M000011.html');return false;">
117
+ <a href="Base.src/M000014.html" target="Code" class="method-signature"
118
+ onclick="popupCode('Base.src/M000014.html');return false;">
119
119
  <span class="method-name">new</span><span class="method-args">(request, options = {}) {|block.arity == 1 ? token : [token, consumer_key,nonce,request.timestamp]| ...}</span>
120
120
  </a>
121
121
  </div>
@@ -10,7 +10,7 @@
10
10
  <link rel="stylesheet" href="../../../.././rdoc-style.css" type="text/css" media="screen" />
11
11
  </head>
12
12
  <body class="standalone-code">
13
- <pre><span class="ruby-comment cmt"># File lib/simple_mapper/default_plugins/oauth.rb, line 9</span>
13
+ <pre><span class="ruby-comment cmt"># File lib/simple_mapper/default_plugins/oauth.rb, line 8</span>
14
14
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">request</span>, <span class="ruby-identifier">options</span> = {}, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
15
15
  <span class="ruby-identifier">raise</span> <span class="ruby-constant">TypeError</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">request</span>.<span class="ruby-identifier">kind_of?</span>(<span class="ruby-constant">OAuth</span><span class="ruby-operator">::</span><span class="ruby-constant">RequestProxy</span><span class="ruby-operator">::</span><span class="ruby-constant">Base</span>)
16
16
  <span class="ruby-ivar">@request</span> = <span class="ruby-identifier">request</span>
@@ -94,11 +94,11 @@ We&#8216;ll have an instance of these for each controller-model pair.
94
94
  <h3 class="section-bar">Methods</h3>
95
95
 
96
96
  <div class="name-list">
97
- <a href="#M000008">authenticate!</a>&nbsp;&nbsp;
98
- <a href="#M000006">authorized?</a>&nbsp;&nbsp;
99
- <a href="#M000005">new</a>&nbsp;&nbsp;
100
- <a href="#M000009">request_signed!</a>&nbsp;&nbsp;
101
- <a href="#M000007">scriptable?</a>&nbsp;&nbsp;
97
+ <a href="#M000011">authenticate!</a>&nbsp;&nbsp;
98
+ <a href="#M000009">authorized?</a>&nbsp;&nbsp;
99
+ <a href="#M000008">new</a>&nbsp;&nbsp;
100
+ <a href="#M000012">request_signed!</a>&nbsp;&nbsp;
101
+ <a href="#M000010">scriptable?</a>&nbsp;&nbsp;
102
102
  </div>
103
103
  </div>
104
104
 
@@ -151,12 +151,12 @@ We&#8216;ll have an instance of these for each controller-model pair.
151
151
  <div id="methods">
152
152
  <h3 class="section-bar">Public Class methods</h3>
153
153
 
154
- <div id="method-M000005" class="method-detail">
155
- <a name="M000005"></a>
154
+ <div id="method-M000008" class="method-detail">
155
+ <a name="M000008"></a>
156
156
 
157
157
  <div class="method-heading">
158
- <a href="OAuthController.src/M000005.html" target="Code" class="method-signature"
159
- onclick="popupCode('OAuthController.src/M000005.html');return false;">
158
+ <a href="OAuthController.src/M000008.html" target="Code" class="method-signature"
159
+ onclick="popupCode('OAuthController.src/M000008.html');return false;">
160
160
  <span class="method-name">new</span><span class="method-args">(controller, model, consumer_key, consumer_secret, options={})</span>
161
161
  </a>
162
162
  </div>
@@ -167,12 +167,12 @@ We&#8216;ll have an instance of these for each controller-model pair.
167
167
 
168
168
  <h3 class="section-bar">Public Instance methods</h3>
169
169
 
170
- <div id="method-M000008" class="method-detail">
171
- <a name="M000008"></a>
170
+ <div id="method-M000011" class="method-detail">
171
+ <a name="M000011"></a>
172
172
 
173
173
  <div class="method-heading">
174
- <a href="OAuthController.src/M000008.html" target="Code" class="method-signature"
175
- onclick="popupCode('OAuthController.src/M000008.html');return false;">
174
+ <a href="OAuthController.src/M000011.html" target="Code" class="method-signature"
175
+ onclick="popupCode('OAuthController.src/M000011.html');return false;">
176
176
  <span class="method-name">authenticate!</span><span class="method-args">()</span>
177
177
  </a>
178
178
  </div>
@@ -186,12 +186,12 @@ redirects when necessary.
186
186
  </div>
187
187
  </div>
188
188
 
189
- <div id="method-M000006" class="method-detail">
190
- <a name="M000006"></a>
189
+ <div id="method-M000009" class="method-detail">
190
+ <a name="M000009"></a>
191
191
 
192
192
  <div class="method-heading">
193
- <a href="OAuthController.src/M000006.html" target="Code" class="method-signature"
194
- onclick="popupCode('OAuthController.src/M000006.html');return false;">
193
+ <a href="OAuthController.src/M000009.html" target="Code" class="method-signature"
194
+ onclick="popupCode('OAuthController.src/M000009.html');return false;">
195
195
  <span class="method-name">authorized?</span><span class="method-args">()</span>
196
196
  </a>
197
197
  </div>
@@ -200,12 +200,12 @@ redirects when necessary.
200
200
  </div>
201
201
  </div>
202
202
 
203
- <div id="method-M000009" class="method-detail">
204
- <a name="M000009"></a>
203
+ <div id="method-M000012" class="method-detail">
204
+ <a name="M000012"></a>
205
205
 
206
206
  <div class="method-heading">
207
- <a href="OAuthController.src/M000009.html" target="Code" class="method-signature"
208
- onclick="popupCode('OAuthController.src/M000009.html');return false;">
207
+ <a href="OAuthController.src/M000012.html" target="Code" class="method-signature"
208
+ onclick="popupCode('OAuthController.src/M000012.html');return false;">
209
209
  <span class="method-name">request_signed!</span><span class="method-args">(request)</span>
210
210
  </a>
211
211
  </div>
@@ -214,12 +214,12 @@ redirects when necessary.
214
214
  </div>
215
215
  </div>
216
216
 
217
- <div id="method-M000007" class="method-detail">
218
- <a name="M000007"></a>
217
+ <div id="method-M000010" class="method-detail">
218
+ <a name="M000010"></a>
219
219
 
220
220
  <div class="method-heading">
221
- <a href="OAuthController.src/M000007.html" target="Code" class="method-signature"
222
- onclick="popupCode('OAuthController.src/M000007.html');return false;">
221
+ <a href="OAuthController.src/M000010.html" target="Code" class="method-signature"
222
+ onclick="popupCode('OAuthController.src/M000010.html');return false;">
223
223
  <span class="method-name">scriptable?</span><span class="method-args">()</span>
224
224
  </a>
225
225
  </div>
@@ -5,21 +5,18 @@
5
5
 
6
6
  <html>
7
7
  <head>
8
- <title>authenticate! (OAuthController)</title>
8
+ <title>new (OAuthController)</title>
9
9
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
10
  <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
11
11
  </head>
12
12
  <body class="standalone-code">
13
- <pre><span class="ruby-comment cmt"># File lib/simple_mapper/default_plugins/oauth.rb, line 122</span>
14
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">authenticate!</span>
15
- <span class="ruby-comment cmt"># 1) If we have no tokens, get a request_token and run the authorization method.</span>
16
- <span class="ruby-comment cmt"># 2) If we have a request_token, assume the user has already answered the question, go ahead and try to get an access_token.</span>
17
- <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">access_token</span>
18
- <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">true</span>
19
- <span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">request_token</span>
20
- <span class="ruby-keyword kw">return</span> <span class="ruby-ivar">@controller</span>.<span class="ruby-identifier">begin_pathway</span>(<span class="ruby-ivar">@options</span>[<span class="ruby-identifier">:authorization_method</span>].<span class="ruby-identifier">in_context</span>(<span class="ruby-identifier">controller</span>).<span class="ruby-identifier">call</span>(<span class="ruby-ivar">@model</span>)) <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@options</span>[<span class="ruby-identifier">:authorization_method</span>].<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Proc</span>)
21
- <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">true</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">access_token</span> <span class="ruby-comment cmt"># For scriptables</span>
22
- <span class="ruby-keyword kw">end</span>
13
+ <pre><span class="ruby-comment cmt"># File lib/simple_mapper/default_plugins/oauth.rb, line 101</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">controller</span>, <span class="ruby-identifier">model</span>, <span class="ruby-identifier">consumer_key</span>, <span class="ruby-identifier">consumer_secret</span>, <span class="ruby-identifier">options</span>={})
15
+ <span class="ruby-ivar">@controller</span> = <span class="ruby-identifier">controller</span>
16
+ <span class="ruby-ivar">@model</span> = <span class="ruby-identifier">model</span>
17
+ <span class="ruby-ivar">@options</span> = <span class="ruby-constant">DEFAULT_OPTIONS</span>.<span class="ruby-identifier">merge</span>(<span class="ruby-identifier">options</span>)
18
+ <span class="ruby-ivar">@model</span> = <span class="ruby-ivar">@options</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-identifier">:model</span>)
19
+ <span class="ruby-ivar">@consumer</span> = <span class="ruby-constant">OAuth</span><span class="ruby-operator">::</span><span class="ruby-constant">Consumer</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">consumer_key</span>, <span class="ruby-identifier">consumer_secret</span>, <span class="ruby-identifier">options</span>)
23
20
  <span class="ruby-keyword kw">end</span></pre>
24
21
  </body>
25
22
  </html>
@@ -5,15 +5,14 @@
5
5
 
6
6
  <html>
7
7
  <head>
8
- <title>request_signed! (OAuthController)</title>
8
+ <title>authorized? (OAuthController)</title>
9
9
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
10
  <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
11
11
  </head>
12
12
  <body class="standalone-code">
13
- <pre><span class="ruby-comment cmt"># File lib/simple_mapper/default_plugins/oauth.rb, line 133</span>
14
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">request_signed!</span>(<span class="ruby-identifier">request</span>)
15
- <span class="ruby-ivar">@consumer</span>.<span class="ruby-identifier">sign!</span>(<span class="ruby-identifier">request</span>, <span class="ruby-identifier">current_token</span>)
16
- <span class="ruby-identifier">request</span>
13
+ <pre><span class="ruby-comment cmt"># File lib/simple_mapper/default_plugins/oauth.rb, line 109</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">authorized?</span>
15
+ <span class="ruby-operator">!</span><span class="ruby-operator">!</span><span class="ruby-identifier">session</span>[<span class="ruby-identifier">:access_token</span>]
17
16
  <span class="ruby-keyword kw">end</span></pre>
18
17
  </body>
19
18
  </html>
@@ -10,7 +10,7 @@
10
10
  <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
11
11
  </head>
12
12
  <body class="standalone-code">
13
- <pre><span class="ruby-comment cmt"># File lib/simple_mapper/default_plugins/oauth.rb, line 116</span>
13
+ <pre><span class="ruby-comment cmt"># File lib/simple_mapper/default_plugins/oauth.rb, line 113</span>
14
14
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">scriptable?</span>
15
15
  <span class="ruby-ivar">@options</span>[<span class="ruby-identifier">:authorization_method</span>] <span class="ruby-operator">==</span> <span class="ruby-identifier">:scriptable</span>
16
16
  <span class="ruby-keyword kw">end</span></pre>
@@ -0,0 +1,25 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>authenticate! (OAuthController)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre><span class="ruby-comment cmt"># File lib/simple_mapper/default_plugins/oauth.rb, line 119</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">authenticate!</span>
15
+ <span class="ruby-comment cmt"># 1) If we have no tokens, get a request_token and run the authorization method.</span>
16
+ <span class="ruby-comment cmt"># 2) If we have a request_token, assume the user has already answered the question, go ahead and try to get an access_token.</span>
17
+ <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">access_token</span>
18
+ <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">true</span>
19
+ <span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">request_token</span>
20
+ <span class="ruby-keyword kw">return</span> <span class="ruby-ivar">@controller</span>.<span class="ruby-identifier">begin_pathway</span>(<span class="ruby-ivar">@options</span>[<span class="ruby-identifier">:authorization_method</span>].<span class="ruby-identifier">in_context</span>(<span class="ruby-identifier">controller</span>).<span class="ruby-identifier">call</span>(<span class="ruby-ivar">@model</span>)) <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@options</span>[<span class="ruby-identifier">:authorization_method</span>].<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Proc</span>)
21
+ <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">true</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">access_token</span> <span class="ruby-comment cmt"># For scriptables</span>
22
+ <span class="ruby-keyword kw">end</span>
23
+ <span class="ruby-keyword kw">end</span></pre>
24
+ </body>
25
+ </html>
@@ -0,0 +1,19 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>request_signed! (OAuthController)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre><span class="ruby-comment cmt"># File lib/simple_mapper/default_plugins/oauth.rb, line 130</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">request_signed!</span>(<span class="ruby-identifier">request</span>)
15
+ <span class="ruby-ivar">@consumer</span>.<span class="ruby-identifier">sign!</span>(<span class="ruby-identifier">request</span>, <span class="ruby-identifier">current_token</span>)
16
+ <span class="ruby-identifier">request</span>
17
+ <span class="ruby-keyword kw">end</span></pre>
18
+ </body>
19
+ </html>