simplemapper 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/LICENSE +1 -1
- data/README +16 -0
- data/Rakefile +1 -1
- data/doc/classes/Array.html +24 -5
- data/doc/classes/{Inflector.src/M000017.html → Array.src/M000005.html} +4 -8
- data/doc/classes/Array.src/{M000001.html → M000006.html} +1 -1
- data/doc/classes/Callbacks.html +15 -15
- data/doc/classes/Callbacks.src/{M000037.html → M000040.html} +0 -0
- data/doc/classes/Callbacks.src/{M000038.html → M000041.html} +0 -0
- data/doc/classes/Callbacks.src/{M000039.html → M000042.html} +0 -0
- data/doc/classes/Enumerable.html +5 -5
- data/doc/classes/Enumerable.src/{M000040.html → M000043.html} +1 -1
- data/doc/classes/Hash.html +23 -4
- data/doc/classes/Hash.src/M000002.html +6 -4
- data/doc/classes/Hash.src/M000003.html +4 -20
- data/doc/classes/Hash.src/M000004.html +34 -0
- data/doc/classes/Inflector/Inflections.html +40 -40
- data/doc/classes/Inflector/Inflections.src/M000034.html +4 -5
- data/doc/classes/Inflector/Inflections.src/M000035.html +4 -4
- data/doc/classes/Inflector/Inflections.src/M000036.html +4 -9
- data/doc/classes/Inflector/Inflections.src/M000037.html +19 -0
- data/doc/classes/Inflector/Inflections.src/{M000031.html → M000038.html} +4 -4
- data/doc/classes/Inflector/Inflections.src/M000039.html +23 -0
- data/doc/classes/Inflector.html +82 -82
- data/doc/classes/Inflector.src/M000020.html +6 -6
- data/doc/classes/Inflector.src/M000021.html +11 -4
- data/doc/classes/Inflector.src/M000022.html +11 -8
- data/doc/classes/Inflector.src/M000023.html +8 -4
- data/doc/classes/Inflector.src/M000024.html +4 -4
- data/doc/classes/Inflector.src/M000025.html +8 -4
- data/doc/classes/Inflector.src/M000026.html +4 -4
- data/doc/classes/Inflector.src/M000027.html +4 -5
- data/doc/classes/Inflector.src/M000028.html +4 -4
- data/doc/classes/Inflector.src/M000029.html +4 -8
- data/doc/classes/Inflector.src/M000030.html +5 -13
- data/doc/classes/Inflector.src/M000031.html +18 -0
- data/doc/classes/Inflector.src/M000032.html +22 -0
- data/doc/classes/Inflector.src/M000033.html +27 -0
- data/doc/classes/Merb/Request.html +5 -5
- data/doc/classes/Merb/Request.src/{M000041.html → M000044.html} +1 -1
- data/doc/classes/OAuth/RequestProxy/Base.html +5 -5
- data/doc/classes/OAuth/RequestProxy/Base.src/{M000012.html → M000015.html} +1 -1
- data/doc/classes/OAuth/Signature/Base.html +5 -5
- data/doc/classes/OAuth/Signature/Base.src/{M000011.html → M000014.html} +1 -1
- data/doc/classes/OAuthController.html +25 -25
- data/doc/classes/OAuthController.src/M000008.html +8 -11
- data/doc/classes/OAuthController.src/M000009.html +4 -5
- data/doc/classes/OAuthController.src/{M000007.html → M000010.html} +1 -1
- data/doc/classes/OAuthController.src/M000011.html +25 -0
- data/doc/classes/OAuthController.src/M000012.html +19 -0
- data/doc/classes/Object.html +18 -6
- data/doc/classes/Object.src/{M000010.html → M000013.html} +2 -2
- data/doc/classes/Proc.html +5 -5
- data/doc/classes/Proc.src/{M000004.html → M000007.html} +0 -0
- data/doc/classes/Serialize.html +20 -20
- data/doc/classes/Serialize.src/M000016.html +7 -32
- data/doc/classes/Serialize.src/{M000014.html → M000017.html} +1 -1
- data/doc/classes/Serialize.src/{M000015.html → M000018.html} +1 -1
- data/doc/classes/Serialize.src/M000019.html +18 -0
- data/doc/classes/SimpleMapper/Base.html +149 -124
- data/doc/classes/SimpleMapper/Base.src/M000067.html +3 -8
- data/doc/classes/SimpleMapper/Base.src/M000068.html +3 -13
- data/doc/classes/SimpleMapper/Base.src/M000069.html +4 -4
- data/doc/classes/SimpleMapper/Base.src/M000070.html +15 -4
- data/doc/classes/SimpleMapper/Base.src/M000071.html +7 -4
- data/doc/classes/SimpleMapper/Base.src/M000072.html +4 -5
- data/doc/classes/SimpleMapper/Base.src/M000073.html +12 -9
- data/doc/classes/SimpleMapper/Base.src/M000074.html +8 -5
- data/doc/classes/SimpleMapper/Base.src/M000075.html +5 -7
- data/doc/classes/SimpleMapper/Base.src/M000076.html +5 -5
- data/doc/classes/SimpleMapper/Base.src/M000077.html +6 -5
- data/doc/classes/SimpleMapper/Base.src/M000078.html +10 -6
- data/doc/classes/SimpleMapper/Base.src/M000079.html +4 -4
- data/doc/classes/SimpleMapper/Base.src/M000080.html +6 -4
- data/doc/classes/SimpleMapper/Base.src/M000081.html +4 -5
- data/doc/classes/SimpleMapper/Base.src/M000082.html +4 -6
- data/doc/classes/SimpleMapper/Base.src/M000083.html +5 -10
- data/doc/classes/SimpleMapper/Base.src/M000084.html +4 -4
- data/doc/classes/SimpleMapper/{HttpAdapter.src/M000057.html → Base.src/M000085.html} +4 -4
- data/doc/classes/SimpleMapper/Base.src/M000086.html +19 -0
- data/doc/classes/SimpleMapper/Base.src/M000087.html +20 -0
- data/doc/classes/SimpleMapper/Base.src/M000088.html +24 -0
- data/doc/classes/SimpleMapper/Base.src/M000089.html +18 -0
- data/doc/classes/SimpleMapper/HttpAdapter.html +40 -40
- data/doc/classes/SimpleMapper/HttpAdapter.src/{M000056.html → M000059.html} +1 -1
- data/doc/classes/SimpleMapper/HttpAdapter.src/M000060.html +4 -4
- data/doc/classes/SimpleMapper/HttpAdapter.src/M000061.html +5 -4
- data/doc/classes/SimpleMapper/HttpAdapter.src/M000063.html +5 -4
- data/doc/classes/SimpleMapper/HttpAdapter.src/M000064.html +18 -0
- data/doc/classes/SimpleMapper/HttpAdapter.src/{M000062.html → M000065.html} +1 -1
- data/doc/classes/SimpleMapper/HttpAdapter.src/M000066.html +18 -0
- data/doc/classes/SimpleMapper/HttpOAuthExtension.html +22 -22
- data/doc/classes/SimpleMapper/HttpOAuthExtension.src/M000051.html +27 -4
- data/doc/classes/SimpleMapper/HttpOAuthExtension.src/{M000049.html → M000052.html} +1 -3
- data/doc/classes/SimpleMapper/HttpOAuthExtension.src/{M000050.html → M000053.html} +1 -1
- data/doc/classes/SimpleMapper/HttpOAuthExtension.src/M000054.html +24 -0
- data/doc/classes/SimpleMapper/SimpleModel/ClassMethods.html +10 -10
- data/doc/classes/SimpleMapper/SimpleModel/ClassMethods.src/{M000046.html → M000049.html} +0 -0
- data/doc/classes/SimpleMapper/SimpleModel/ClassMethods.src/{M000047.html → M000050.html} +0 -0
- data/doc/classes/SimpleMapper/SimpleModel.html +20 -20
- data/doc/classes/SimpleMapper/SimpleModel.src/M000045.html +4 -10
- data/doc/classes/SimpleMapper/SimpleModel.src/{M000043.html → M000046.html} +0 -0
- data/doc/classes/SimpleMapper/SimpleModel.src/{M000044.html → M000047.html} +0 -0
- data/doc/classes/SimpleMapper/SimpleModel.src/M000048.html +24 -0
- data/doc/classes/SimpleMapper/XmlFormat/ClassMethods.html +5 -5
- data/doc/classes/SimpleMapper/XmlFormat/ClassMethods.src/{M000055.html → M000058.html} +5 -3
- data/doc/classes/SimpleMapper/XmlFormat.html +15 -15
- data/doc/classes/SimpleMapper/XmlFormat.src/{M000052.html → M000055.html} +1 -1
- data/doc/classes/SimpleMapper/XmlFormat.src/{M000053.html → M000056.html} +1 -1
- data/doc/classes/SimpleMapper/XmlFormat.src/{M000054.html → M000057.html} +4 -2
- data/doc/classes/Time.html +139 -0
- data/doc/classes/{OAuthController.src/M000006.html → Time.src/M000001.html} +4 -4
- data/doc/created.rid +1 -1
- data/doc/files/lib/simple_mapper/adapters/http_adapter_rb.html +2 -1
- data/doc/files/lib/simple_mapper/base_rb.html +1 -1
- data/doc/files/lib/simple_mapper/default_plugins/callbacks_rb.html +1 -1
- data/doc/files/lib/simple_mapper/default_plugins/oauth_rb.html +1 -7
- data/doc/files/lib/simple_mapper/default_plugins/options_to_query_rb.html +116 -0
- data/doc/files/lib/simple_mapper/default_plugins/simple_model_rb.html +1 -1
- data/doc/files/lib/simple_mapper/formats/xml_format_rb.html +3 -1
- data/doc/files/lib/simple_mapper/support/bliss_serializer_rb.html +2 -1
- data/doc/files/lib/simple_mapper/support/core_ext_rb.html +1 -1
- data/doc/files/lib/simple_mapper/support/inflections_rb.html +1 -1
- data/doc/files/lib/simple_mapper/support/inflector_rb.html +1 -1
- data/doc/files/lib/simple_mapper/support_rb.html +1 -1
- data/doc/files/lib/simple_mapper_rb.html +1 -1
- data/doc/fr_class_index.html +1 -0
- data/doc/fr_file_index.html +1 -0
- data/doc/fr_method_index.html +89 -84
- data/lib/simple_mapper/adapters/http_adapter.rb +4 -2
- data/lib/simple_mapper/base.rb +46 -23
- data/lib/simple_mapper/default_plugins/oauth.rb +3 -6
- data/lib/simple_mapper/default_plugins/options_to_query.rb +31 -0
- data/lib/simple_mapper/formats/xml_format.rb +10 -3
- data/lib/simple_mapper/support/bliss_serializer.rb +3 -113
- data/lib/simple_mapper/support/core_ext.rb +6 -2
- data/lib/simple_mapper/support/inflections.rb +1 -1
- metadata +52 -43
- data/doc/classes/Inflector/Inflections.src/M000032.html +0 -18
- data/doc/classes/Inflector/Inflections.src/M000033.html +0 -18
- data/doc/classes/Inflector.src/M000018.html +0 -25
- data/doc/classes/Inflector.src/M000019.html +0 -25
- data/doc/classes/OAuthController.src/M000005.html +0 -22
- data/doc/classes/Serialize.src/M000013.html +0 -21
- data/doc/classes/SimpleMapper/Base.src/M000064.html +0 -16
- data/doc/classes/SimpleMapper/Base.src/M000065.html +0 -16
- data/doc/classes/SimpleMapper/Base.src/M000066.html +0 -22
- data/doc/classes/SimpleMapper/HttpAdapter.src/M000058.html +0 -19
- data/doc/classes/SimpleMapper/HttpOAuthExtension.src/M000048.html +0 -49
- data/doc/classes/SimpleMapper/SimpleModel.src/M000042.html +0 -18
|
@@ -5,14 +5,18 @@
|
|
|
5
5
|
|
|
6
6
|
<html>
|
|
7
7
|
<head>
|
|
8
|
-
<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
|
|
14
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">
|
|
15
|
-
<span class="ruby-identifier">
|
|
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">"-"</span>, <span class="ruby-value str">"_"</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>
|
|
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
|
|
14
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">
|
|
15
|
-
<span class="ruby-identifier">
|
|
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>
|
|
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
|
|
14
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">
|
|
15
|
-
<span class="ruby-
|
|
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">""</span>).<span class="ruby-identifier">gsub</span>(<span class="ruby-regexp re">/_/</span>, <span class="ruby-value str">" "</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>
|
|
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
|
|
14
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">
|
|
15
|
-
<span class="ruby-identifier">
|
|
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>
|
|
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
|
|
14
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">
|
|
15
|
-
<span class="ruby-
|
|
16
|
-
<span class="ruby-identifier">raise</span> <span class="ruby-constant">NameError</span>, <span class="ruby-node">"#{camel_cased_word.inspect} is not a valid constant name!"</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">"::#{$1}"</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>
|
|
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
|
|
14
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">
|
|
15
|
-
<span class="ruby-
|
|
16
|
-
|
|
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">"#{number}st"</span>
|
|
20
|
-
<span class="ruby-keyword kw">when</span> <span class="ruby-value">2</span><span class="ruby-operator">:</span> <span class="ruby-node">"#{number}nd"</span>
|
|
21
|
-
<span class="ruby-keyword kw">when</span> <span class="ruby-value">3</span><span class="ruby-operator">:</span> <span class="ruby-node">"#{number}rd"</span>
|
|
22
|
-
<span class="ruby-keyword kw">else</span> <span class="ruby-node">"#{number}th"</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">"_id"</span> <span class="ruby-operator">:</span> <span class="ruby-value str">"id"</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">"#{camel_cased_word.inspect} is not a valid constant name!"</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">"::#{$1}"</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">"#{number}th"</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">"#{number}st"</span>
|
|
20
|
+
<span class="ruby-keyword kw">when</span> <span class="ruby-value">2</span><span class="ruby-operator">:</span> <span class="ruby-node">"#{number}nd"</span>
|
|
21
|
+
<span class="ruby-keyword kw">when</span> <span class="ruby-value">3</span><span class="ruby-operator">:</span> <span class="ruby-node">"#{number}rd"</span>
|
|
22
|
+
<span class="ruby-keyword kw">else</span> <span class="ruby-node">"#{number}th"</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="#
|
|
91
|
+
<a href="#M000044">xml_params</a>
|
|
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-
|
|
114
|
-
<a name="
|
|
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/
|
|
118
|
-
onclick="popupCode('Request.src/
|
|
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
|
|
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="#
|
|
91
|
+
<a href="#M000015">inspect</a>
|
|
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-
|
|
114
|
-
<a name="
|
|
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/
|
|
118
|
-
onclick="popupCode('Base.src/
|
|
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
|
|
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">"#<OAuth::RequestProxy::MerbRequest:#{object_id}\n\tconsumer_key: #{consumer_key}\n\ttoken: #{token}\n\tparameters: #{parameters.inspect}\n>"</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="#
|
|
91
|
+
<a href="#M000014">new</a>
|
|
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-
|
|
114
|
-
<a name="
|
|
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/
|
|
118
|
-
onclick="popupCode('Base.src/
|
|
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
|
|
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">&</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‘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="#
|
|
98
|
-
<a href="#
|
|
99
|
-
<a href="#
|
|
100
|
-
<a href="#
|
|
101
|
-
<a href="#
|
|
97
|
+
<a href="#M000011">authenticate!</a>
|
|
98
|
+
<a href="#M000009">authorized?</a>
|
|
99
|
+
<a href="#M000008">new</a>
|
|
100
|
+
<a href="#M000012">request_signed!</a>
|
|
101
|
+
<a href="#M000010">scriptable?</a>
|
|
102
102
|
</div>
|
|
103
103
|
</div>
|
|
104
104
|
|
|
@@ -151,12 +151,12 @@ We‘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-
|
|
155
|
-
<a name="
|
|
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/
|
|
159
|
-
onclick="popupCode('OAuthController.src/
|
|
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‘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-
|
|
171
|
-
<a name="
|
|
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/
|
|
175
|
-
onclick="popupCode('OAuthController.src/
|
|
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-
|
|
190
|
-
<a name="
|
|
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/
|
|
194
|
-
onclick="popupCode('OAuthController.src/
|
|
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-
|
|
204
|
-
<a name="
|
|
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/
|
|
208
|
-
onclick="popupCode('OAuthController.src/
|
|
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-
|
|
218
|
-
<a name="
|
|
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/
|
|
222
|
-
onclick="popupCode('OAuthController.src/
|
|
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>
|
|
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
|
|
14
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">
|
|
15
|
-
<span class="ruby-
|
|
16
|
-
<span class="ruby-
|
|
17
|
-
<span class="ruby-
|
|
18
|
-
|
|
19
|
-
<span class="ruby-
|
|
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>
|
|
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
|
|
14
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">
|
|
15
|
-
<span class="ruby-
|
|
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
|
|
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>
|