simplemapper 0.0.2 → 0.0.4
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/Rakefile +3 -3
- data/doc/classes/Enumerable.html +5 -5
- data/doc/classes/Enumerable.src/{M000043.html → M000040.html} +0 -0
- data/doc/classes/Merb/Request.html +5 -5
- data/doc/classes/Merb/Request.src/{M000044.html → M000041.html} +0 -0
- data/doc/classes/OAuthController.src/M000008.html +1 -1
- data/doc/classes/OAuthController.src/M000009.html +1 -1
- data/doc/classes/OAuthController.src/M000010.html +1 -1
- data/doc/classes/OAuthController.src/M000011.html +1 -1
- data/doc/classes/OAuthController.src/M000012.html +1 -1
- data/doc/classes/Serialize.src/M000019.html +1 -1
- data/doc/classes/SimpleMapper.html +6 -1
- data/doc/classes/SimpleMapper/Base.html +172 -104
- data/doc/classes/SimpleMapper/Base.src/M000071.html +4 -7
- data/doc/classes/SimpleMapper/Base.src/M000072.html +7 -4
- data/doc/classes/SimpleMapper/Base.src/M000073.html +4 -12
- data/doc/classes/SimpleMapper/Base.src/M000074.html +13 -7
- data/doc/classes/SimpleMapper/Base.src/M000075.html +6 -3
- data/doc/classes/SimpleMapper/Base.src/M000076.html +4 -4
- data/doc/classes/SimpleMapper/Base.src/M000077.html +4 -5
- data/doc/classes/SimpleMapper/Base.src/M000078.html +5 -9
- data/doc/classes/SimpleMapper/Base.src/M000079.html +10 -5
- data/doc/classes/SimpleMapper/Base.src/M000080.html +8 -7
- data/doc/classes/SimpleMapper/Base.src/M000081.html +4 -4
- data/doc/classes/SimpleMapper/Base.src/M000082.html +5 -4
- data/doc/classes/SimpleMapper/Base.src/M000083.html +4 -5
- data/doc/classes/SimpleMapper/Base.src/M000085.html +4 -4
- data/doc/classes/SimpleMapper/Base.src/M000086.html +5 -5
- data/doc/classes/SimpleMapper/Base.src/M000087.html +3 -5
- data/doc/classes/SimpleMapper/Base.src/M000088.html +4 -10
- data/doc/classes/SimpleMapper/Base.src/M000089.html +4 -4
- data/doc/classes/SimpleMapper/Base.src/M000090.html +19 -0
- data/doc/classes/SimpleMapper/Base.src/M000091.html +20 -0
- data/doc/classes/SimpleMapper/Base.src/M000092.html +24 -0
- data/doc/classes/SimpleMapper/Base.src/M000093.html +18 -0
- data/doc/classes/{Callbacks.html → SimpleMapper/CallbacksExtension.html} +19 -19
- data/doc/classes/SimpleMapper/CallbacksExtension.src/M000056.html +18 -0
- data/doc/classes/SimpleMapper/{Base.src/M000084.html → CallbacksExtension.src/M000057.html} +4 -4
- data/doc/classes/SimpleMapper/CallbacksExtension.src/M000058.html +19 -0
- data/doc/classes/SimpleMapper/HttpAdapter.html +10 -1
- data/doc/classes/SimpleMapper/HttpAdapter.src/M000059.html +1 -1
- data/doc/classes/SimpleMapper/HttpAdapter.src/M000060.html +1 -1
- data/doc/classes/SimpleMapper/HttpAdapter.src/M000061.html +1 -1
- data/doc/classes/SimpleMapper/HttpAdapter.src/M000063.html +1 -1
- data/doc/classes/SimpleMapper/HttpAdapter.src/M000064.html +1 -1
- data/doc/classes/SimpleMapper/HttpAdapter.src/M000065.html +1 -1
- data/doc/classes/SimpleMapper/HttpAdapter.src/M000066.html +1 -1
- data/doc/classes/SimpleMapper/HttpOAuthExtension.html +22 -22
- data/doc/classes/SimpleMapper/HttpOAuthExtension.src/M000048.html +47 -0
- data/doc/classes/SimpleMapper/HttpOAuthExtension.src/{M000052.html → M000049.html} +0 -0
- data/doc/classes/SimpleMapper/HttpOAuthExtension.src/{M000053.html → M000050.html} +0 -0
- data/doc/classes/SimpleMapper/HttpOAuthExtension.src/M000051.html +3 -26
- data/doc/classes/SimpleMapper/SimpleModel.html +20 -20
- data/doc/classes/SimpleMapper/SimpleModel.src/M000042.html +18 -0
- data/doc/classes/SimpleMapper/SimpleModel.src/{M000046.html → M000043.html} +0 -0
- data/doc/classes/SimpleMapper/SimpleModel.src/{M000047.html → M000044.html} +0 -0
- data/doc/classes/SimpleMapper/SimpleModel.src/M000045.html +10 -4
- data/doc/classes/SimpleMapper/SimpleModel/ClassMethods.html +10 -10
- data/doc/classes/SimpleMapper/SimpleModel/ClassMethods.src/{M000049.html → M000046.html} +0 -0
- data/doc/classes/SimpleMapper/SimpleModel/ClassMethods.src/{M000050.html → M000047.html} +0 -0
- data/doc/classes/SimpleMapper/XmlFormat.html +15 -15
- data/doc/classes/SimpleMapper/XmlFormat.src/{M000055.html → M000052.html} +0 -0
- data/doc/classes/SimpleMapper/XmlFormat.src/{M000056.html → M000053.html} +0 -0
- data/doc/classes/SimpleMapper/XmlFormat.src/{M000057.html → M000054.html} +1 -1
- data/doc/classes/SimpleMapper/XmlFormat/ClassMethods.html +5 -5
- data/doc/classes/SimpleMapper/XmlFormat/ClassMethods.src/{M000058.html → M000055.html} +2 -2
- data/doc/created.rid +1 -1
- data/doc/files/LICENSE.html +129 -0
- data/doc/files/README.html +130 -0
- data/doc/files/lib/simple_mapper/adapters/http_adapter_rb.html +1 -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 -1
- data/doc/files/lib/simple_mapper/default_plugins/options_to_query_rb.html +1 -1
- data/doc/files/lib/simple_mapper/formats/xml_format_rb.html +1 -1
- data/doc/files/lib/simple_mapper/support/bliss_serializer_rb.html +1 -1
- data/doc/fr_class_index.html +1 -1
- data/doc/fr_file_index.html +2 -0
- data/doc/fr_method_index.html +44 -40
- data/doc/index.html +1 -1
- data/lib/simple_mapper/adapters/http_adapter.rb +0 -2
- data/lib/simple_mapper/base.rb +23 -3
- data/lib/simple_mapper/default_plugins/callbacks.rb +14 -9
- data/lib/simple_mapper/default_plugins/oauth.rb +4 -0
- data/lib/simple_mapper/formats/xml_format.rb +3 -3
- data/lib/simple_mapper/support/bliss_serializer.rb +1 -1
- metadata +27 -22
- data/doc/classes/Callbacks.src/M000040.html +0 -18
- data/doc/classes/Callbacks.src/M000041.html +0 -18
- data/doc/classes/Callbacks.src/M000042.html +0 -19
- data/doc/classes/SimpleMapper/HttpOAuthExtension.src/M000054.html +0 -24
- data/doc/classes/SimpleMapper/SimpleModel.src/M000048.html +0 -24
|
@@ -0,0 +1,24 @@
|
|
|
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>delete (SimpleMapper::Base)</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/base.rb, line 167</span>
|
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">delete</span>
|
|
15
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">connection</span>(<span class="ruby-ivar">@adapter</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">:default</span>).<span class="ruby-identifier">delete</span>(<span class="ruby-identifier">identifier</span>)
|
|
16
|
+
<span class="ruby-ivar">@persisted</span> = <span class="ruby-keyword kw">false</span>
|
|
17
|
+
<span class="ruby-identifier">instance_variable_set</span>(<span class="ruby-value str">'@'</span><span class="ruby-operator">+</span><span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">identifier</span>, <span class="ruby-keyword kw">nil</span>)
|
|
18
|
+
<span class="ruby-keyword kw">true</span>
|
|
19
|
+
<span class="ruby-keyword kw">else</span>
|
|
20
|
+
<span class="ruby-keyword kw">false</span>
|
|
21
|
+
<span class="ruby-keyword kw">end</span>
|
|
22
|
+
<span class="ruby-keyword kw">end</span></pre>
|
|
23
|
+
</body>
|
|
24
|
+
</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>persisted? (SimpleMapper::Base)</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/base.rb, line 177</span>
|
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">persisted?</span>
|
|
15
|
+
<span class="ruby-operator">!</span><span class="ruby-operator">!</span><span class="ruby-ivar">@persisted</span> <span class="ruby-operator">&&</span> (<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">identifier</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-operator">||</span> <span class="ruby-operator">!</span><span class="ruby-identifier">instance_variable_get</span>(<span class="ruby-value str">'@'</span><span class="ruby-operator">+</span><span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">identifier</span>).<span class="ruby-identifier">nil?</span>)
|
|
16
|
+
<span class="ruby-keyword kw">end</span></pre>
|
|
17
|
+
</body>
|
|
18
|
+
</html>
|
|
@@ -5,10 +5,10 @@
|
|
|
5
5
|
|
|
6
6
|
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
|
7
7
|
<head>
|
|
8
|
-
<title>Module:
|
|
8
|
+
<title>Module: SimpleMapper::CallbacksExtension</title>
|
|
9
9
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
|
10
10
|
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
|
11
|
-
<link rel="stylesheet" href="
|
|
11
|
+
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
|
12
12
|
<script type="text/javascript">
|
|
13
13
|
// <![CDATA[
|
|
14
14
|
|
|
@@ -50,12 +50,12 @@
|
|
|
50
50
|
<table class="header-table">
|
|
51
51
|
<tr class="top-aligned-row">
|
|
52
52
|
<td><strong>Module</strong></td>
|
|
53
|
-
<td class="class-name-in-header">
|
|
53
|
+
<td class="class-name-in-header">SimpleMapper::CallbacksExtension</td>
|
|
54
54
|
</tr>
|
|
55
55
|
<tr class="top-aligned-row">
|
|
56
56
|
<td><strong>In:</strong></td>
|
|
57
57
|
<td>
|
|
58
|
-
<a href="
|
|
58
|
+
<a href="../../files/lib/simple_mapper/default_plugins/callbacks_rb.html">
|
|
59
59
|
lib/simple_mapper/default_plugins/callbacks.rb
|
|
60
60
|
</a>
|
|
61
61
|
<br />
|
|
@@ -80,9 +80,9 @@
|
|
|
80
80
|
<h3 class="section-bar">Methods</h3>
|
|
81
81
|
|
|
82
82
|
<div class="name-list">
|
|
83
|
-
<a href="#
|
|
84
|
-
<a href="#
|
|
85
|
-
<a href="#
|
|
83
|
+
<a href="#M000057">add_callback</a>
|
|
84
|
+
<a href="#M000056">callbacks</a>
|
|
85
|
+
<a href="#M000058">run_callback</a>
|
|
86
86
|
</div>
|
|
87
87
|
</div>
|
|
88
88
|
|
|
@@ -104,12 +104,12 @@
|
|
|
104
104
|
<div id="methods">
|
|
105
105
|
<h3 class="section-bar">Public Instance methods</h3>
|
|
106
106
|
|
|
107
|
-
<div id="method-
|
|
108
|
-
<a name="
|
|
107
|
+
<div id="method-M000057" class="method-detail">
|
|
108
|
+
<a name="M000057"></a>
|
|
109
109
|
|
|
110
110
|
<div class="method-heading">
|
|
111
|
-
<a href="
|
|
112
|
-
onclick="popupCode('
|
|
111
|
+
<a href="CallbacksExtension.src/M000057.html" target="Code" class="method-signature"
|
|
112
|
+
onclick="popupCode('CallbacksExtension.src/M000057.html');return false;">
|
|
113
113
|
<span class="method-name">add_callback</span><span class="method-args">(name,&block)</span>
|
|
114
114
|
</a>
|
|
115
115
|
</div>
|
|
@@ -118,12 +118,12 @@
|
|
|
118
118
|
</div>
|
|
119
119
|
</div>
|
|
120
120
|
|
|
121
|
-
<div id="method-
|
|
122
|
-
<a name="
|
|
121
|
+
<div id="method-M000056" class="method-detail">
|
|
122
|
+
<a name="M000056"></a>
|
|
123
123
|
|
|
124
124
|
<div class="method-heading">
|
|
125
|
-
<a href="
|
|
126
|
-
onclick="popupCode('
|
|
125
|
+
<a href="CallbacksExtension.src/M000056.html" target="Code" class="method-signature"
|
|
126
|
+
onclick="popupCode('CallbacksExtension.src/M000056.html');return false;">
|
|
127
127
|
<span class="method-name">callbacks</span><span class="method-args">()</span>
|
|
128
128
|
</a>
|
|
129
129
|
</div>
|
|
@@ -132,12 +132,12 @@
|
|
|
132
132
|
</div>
|
|
133
133
|
</div>
|
|
134
134
|
|
|
135
|
-
<div id="method-
|
|
136
|
-
<a name="
|
|
135
|
+
<div id="method-M000058" class="method-detail">
|
|
136
|
+
<a name="M000058"></a>
|
|
137
137
|
|
|
138
138
|
<div class="method-heading">
|
|
139
|
-
<a href="
|
|
140
|
-
onclick="popupCode('
|
|
139
|
+
<a href="CallbacksExtension.src/M000058.html" target="Code" class="method-signature"
|
|
140
|
+
onclick="popupCode('CallbacksExtension.src/M000058.html');return false;">
|
|
141
141
|
<span class="method-name">run_callback</span><span class="method-args">(name, *args)</span>
|
|
142
142
|
</a>
|
|
143
143
|
</div>
|
|
@@ -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>callbacks (SimpleMapper::CallbacksExtension)</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/callbacks.rb, line 3</span>
|
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">callbacks</span>
|
|
15
|
+
<span class="ruby-ivar">@callbacks</span> <span class="ruby-operator">||=</span> <span class="ruby-constant">Hash</span>.<span class="ruby-identifier">new</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">h</span>,<span class="ruby-identifier">k</span><span class="ruby-operator">|</span> <span class="ruby-identifier">h</span>[<span class="ruby-identifier">k</span>] = []}
|
|
16
|
+
<span class="ruby-keyword kw">end</span></pre>
|
|
17
|
+
</body>
|
|
18
|
+
</html>
|
|
@@ -5,14 +5,14 @@
|
|
|
5
5
|
|
|
6
6
|
<html>
|
|
7
7
|
<head>
|
|
8
|
-
<title>
|
|
8
|
+
<title>add_callback (SimpleMapper::CallbacksExtension)</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/
|
|
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/default_plugins/callbacks.rb, line 6</span>
|
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">add_callback</span>(<span class="ruby-identifier">name</span>,<span class="ruby-operator">&</span><span class="ruby-identifier">block</span>)
|
|
15
|
+
<span class="ruby-identifier">callbacks</span>[<span class="ruby-identifier">name</span>] <span class="ruby-operator"><<</span> <span class="ruby-identifier">block</span>
|
|
16
16
|
<span class="ruby-keyword kw">end</span></pre>
|
|
17
17
|
</body>
|
|
18
18
|
</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>run_callback (SimpleMapper::CallbacksExtension)</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/callbacks.rb, line 9</span>
|
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">run_callback</span>(<span class="ruby-identifier">name</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">args</span>)
|
|
15
|
+
<span class="ruby-identifier">args</span> = <span class="ruby-identifier">args</span>.<span class="ruby-identifier">first</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">args</span>.<span class="ruby-identifier">length</span> <span class="ruby-operator">==</span> <span class="ruby-value">1</span>
|
|
16
|
+
<span class="ruby-identifier">callbacks</span>[<span class="ruby-identifier">name</span>].<span class="ruby-identifier">inject</span>(<span class="ruby-identifier">args</span>) {<span class="ruby-operator">|</span><span class="ruby-identifier">args</span>,<span class="ruby-identifier">cb</span><span class="ruby-operator">|</span> <span class="ruby-identifier">cb</span>.<span class="ruby-identifier">call</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>)}
|
|
17
|
+
<span class="ruby-keyword kw">end</span></pre>
|
|
18
|
+
</body>
|
|
19
|
+
</html>
|
|
@@ -58,6 +58,14 @@
|
|
|
58
58
|
<a href="../../files/lib/simple_mapper/adapters/http_adapter_rb.html">
|
|
59
59
|
lib/simple_mapper/adapters/http_adapter.rb
|
|
60
60
|
</a>
|
|
61
|
+
<br />
|
|
62
|
+
<a href="../../files/lib/simple_mapper/default_plugins/callbacks_rb.html">
|
|
63
|
+
lib/simple_mapper/default_plugins/callbacks.rb
|
|
64
|
+
</a>
|
|
65
|
+
<br />
|
|
66
|
+
<a href="../../files/lib/simple_mapper/default_plugins/oauth_rb.html">
|
|
67
|
+
lib/simple_mapper/default_plugins/oauth.rb
|
|
68
|
+
</a>
|
|
61
69
|
<br />
|
|
62
70
|
</td>
|
|
63
71
|
</tr>
|
|
@@ -107,7 +115,8 @@
|
|
|
107
115
|
<h3 class="section-bar">Included Modules</h3>
|
|
108
116
|
|
|
109
117
|
<div id="includes-list">
|
|
110
|
-
<span class="include-name"><a href="
|
|
118
|
+
<span class="include-name"><a href="CallbacksExtension.html">CallbacksExtension</a></span>
|
|
119
|
+
<span class="include-name"><a href="HttpOAuthExtension.html">HttpOAuthExtension</a></span>
|
|
111
120
|
</div>
|
|
112
121
|
</div>
|
|
113
122
|
|
|
@@ -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/adapters/http_adapter.rb, line
|
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/simple_mapper/adapters/http_adapter.rb, line 16</span>
|
|
14
14
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">base_uri</span>
|
|
15
15
|
<span class="ruby-constant">URI</span>.<span class="ruby-identifier">parse</span>(<span class="ruby-identifier">base_url</span>)
|
|
16
16
|
<span class="ruby-keyword kw">end</span></pre>
|
|
@@ -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/adapters/http_adapter.rb, line
|
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/simple_mapper/adapters/http_adapter.rb, line 20</span>
|
|
14
14
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">headers</span>
|
|
15
15
|
<span class="ruby-ivar">@headers</span> <span class="ruby-operator">||=</span> {}
|
|
16
16
|
<span class="ruby-keyword kw">end</span></pre>
|
|
@@ -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/adapters/http_adapter.rb, line
|
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/simple_mapper/adapters/http_adapter.rb, line 23</span>
|
|
14
14
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">headers=</span>(<span class="ruby-identifier">v</span>)
|
|
15
15
|
<span class="ruby-identifier">raise</span> <span class="ruby-constant">TypeError</span>, <span class="ruby-value str">"headers set must be a hash"</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">v</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Hash</span>)
|
|
16
16
|
<span class="ruby-identifier">headers</span>.<span class="ruby-identifier">merge!</span>(<span class="ruby-identifier">v</span>)
|
|
@@ -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/adapters/http_adapter.rb, line
|
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/simple_mapper/adapters/http_adapter.rb, line 29</span>
|
|
14
14
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">get</span>(<span class="ruby-identifier">find_options</span>={})
|
|
15
15
|
<span class="ruby-identifier">query</span> = <span class="ruby-identifier">find_options</span>.<span class="ruby-identifier">empty?</span> <span class="ruby-value">? </span><span class="ruby-value str">''</span> <span class="ruby-operator">:</span> (<span class="ruby-value str">'?'</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">find_options</span>.<span class="ruby-identifier">to_query</span>)
|
|
16
16
|
<span class="ruby-identifier">http</span>.<span class="ruby-identifier">request</span>(<span class="ruby-identifier">request</span>(<span class="ruby-value str">'get'</span>, <span class="ruby-identifier">base_uri</span>.<span class="ruby-identifier">path</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">query</span>)).<span class="ruby-identifier">body</span>
|
|
@@ -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/adapters/http_adapter.rb, line
|
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/simple_mapper/adapters/http_adapter.rb, line 34</span>
|
|
14
14
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">put</span>(<span class="ruby-identifier">identifier</span>,<span class="ruby-identifier">data</span>)
|
|
15
15
|
<span class="ruby-identifier">http</span>.<span class="ruby-identifier">request</span>(<span class="ruby-identifier">request</span>(<span class="ruby-value str">'put'</span>, <span class="ruby-constant">URI</span>.<span class="ruby-identifier">parse</span>(<span class="ruby-identifier">identifier</span>).<span class="ruby-identifier">path</span>, <span class="ruby-identifier">data</span>)).<span class="ruby-identifier">body</span>
|
|
16
16
|
<span class="ruby-keyword kw">end</span></pre>
|
|
@@ -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/adapters/http_adapter.rb, line
|
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/simple_mapper/adapters/http_adapter.rb, line 38</span>
|
|
14
14
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">post</span>(<span class="ruby-identifier">data</span>)
|
|
15
15
|
<span class="ruby-identifier">http</span>.<span class="ruby-identifier">request</span>(<span class="ruby-identifier">request</span>(<span class="ruby-value str">'post'</span>, <span class="ruby-identifier">base_uri</span>.<span class="ruby-identifier">path</span>, <span class="ruby-identifier">data</span>)).<span class="ruby-identifier">body</span>
|
|
16
16
|
<span class="ruby-keyword kw">end</span></pre>
|
|
@@ -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/adapters/http_adapter.rb, line
|
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/simple_mapper/adapters/http_adapter.rb, line 43</span>
|
|
14
14
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">delete</span>(<span class="ruby-identifier">identifier</span>)
|
|
15
15
|
<span class="ruby-identifier">http</span>.<span class="ruby-identifier">request</span>(<span class="ruby-identifier">request</span>(<span class="ruby-value str">'delete'</span>, <span class="ruby-constant">URI</span>.<span class="ruby-identifier">parse</span>(<span class="ruby-identifier">identifier</span>).<span class="ruby-identifier">path</span>)).<span class="ruby-identifier">body</span>
|
|
16
16
|
<span class="ruby-keyword kw">end</span></pre>
|
|
@@ -80,10 +80,10 @@
|
|
|
80
80
|
<h3 class="section-bar">Methods</h3>
|
|
81
81
|
|
|
82
82
|
<div class="name-list">
|
|
83
|
-
<a href="#
|
|
84
|
-
<a href="#
|
|
85
|
-
<a href="#
|
|
86
|
-
<a href="#
|
|
83
|
+
<a href="#M000050">oauth</a>
|
|
84
|
+
<a href="#M000048">requires_oauth</a>
|
|
85
|
+
<a href="#M000051">set_oauth</a>
|
|
86
|
+
<a href="#M000049">with_oauth</a>
|
|
87
87
|
</div>
|
|
88
88
|
</div>
|
|
89
89
|
|
|
@@ -105,12 +105,12 @@
|
|
|
105
105
|
<div id="methods">
|
|
106
106
|
<h3 class="section-bar">Public Class methods</h3>
|
|
107
107
|
|
|
108
|
-
<div id="method-
|
|
109
|
-
<a name="
|
|
108
|
+
<div id="method-M000049" class="method-detail">
|
|
109
|
+
<a name="M000049"></a>
|
|
110
110
|
|
|
111
111
|
<div class="method-heading">
|
|
112
|
-
<a href="HttpOAuthExtension.src/
|
|
113
|
-
onclick="popupCode('HttpOAuthExtension.src/
|
|
112
|
+
<a href="HttpOAuthExtension.src/M000049.html" target="Code" class="method-signature"
|
|
113
|
+
onclick="popupCode('HttpOAuthExtension.src/M000049.html');return false;">
|
|
114
114
|
<span class="method-name">with_oauth</span><span class="method-args">(controller) {|if block_given?| ...}</span>
|
|
115
115
|
</a>
|
|
116
116
|
</div>
|
|
@@ -118,8 +118,8 @@
|
|
|
118
118
|
<div class="method-description">
|
|
119
119
|
<p>
|
|
120
120
|
Ingeniousity here… ;) Duplicates the class to give it a temporary
|
|
121
|
-
session-attached <a href="HttpOAuthExtension.html#
|
|
122
|
-
sets <a href="HttpOAuthExtension.html#
|
|
121
|
+
session-attached <a href="HttpOAuthExtension.html#M000050">oauth</a> scope,
|
|
122
|
+
sets <a href="HttpOAuthExtension.html#M000050">oauth</a> to the
|
|
123
123
|
Model-Controller-<a href="../OAuth.html">OAuth</a> class, then makes the
|
|
124
124
|
class use the original class for all of its instantiation. NOTE: This only
|
|
125
125
|
really makes the class methods use <a href="../OAuth.html">OAuth</a>. <a
|
|
@@ -131,12 +131,12 @@ play the trick as well.
|
|
|
131
131
|
|
|
132
132
|
<h3 class="section-bar">Public Instance methods</h3>
|
|
133
133
|
|
|
134
|
-
<div id="method-
|
|
135
|
-
<a name="
|
|
134
|
+
<div id="method-M000050" class="method-detail">
|
|
135
|
+
<a name="M000050"></a>
|
|
136
136
|
|
|
137
137
|
<div class="method-heading">
|
|
138
|
-
<a href="HttpOAuthExtension.src/
|
|
139
|
-
onclick="popupCode('HttpOAuthExtension.src/
|
|
138
|
+
<a href="HttpOAuthExtension.src/M000050.html" target="Code" class="method-signature"
|
|
139
|
+
onclick="popupCode('HttpOAuthExtension.src/M000050.html');return false;">
|
|
140
140
|
<span class="method-name">oauth</span><span class="method-args">()</span>
|
|
141
141
|
</a>
|
|
142
142
|
</div>
|
|
@@ -145,12 +145,12 @@ play the trick as well.
|
|
|
145
145
|
</div>
|
|
146
146
|
</div>
|
|
147
147
|
|
|
148
|
-
<div id="method-
|
|
149
|
-
<a name="
|
|
148
|
+
<div id="method-M000048" class="method-detail">
|
|
149
|
+
<a name="M000048"></a>
|
|
150
150
|
|
|
151
151
|
<div class="method-heading">
|
|
152
|
-
<a href="HttpOAuthExtension.src/
|
|
153
|
-
onclick="popupCode('HttpOAuthExtension.src/
|
|
152
|
+
<a href="HttpOAuthExtension.src/M000048.html" target="Code" class="method-signature"
|
|
153
|
+
onclick="popupCode('HttpOAuthExtension.src/M000048.html');return false;">
|
|
154
154
|
<span class="method-name">requires_oauth</span><span class="method-args">(consumer_key, consumer_secret, options={})</span>
|
|
155
155
|
</a>
|
|
156
156
|
</div>
|
|
@@ -159,12 +159,12 @@ play the trick as well.
|
|
|
159
159
|
</div>
|
|
160
160
|
</div>
|
|
161
161
|
|
|
162
|
-
<div id="method-
|
|
163
|
-
<a name="
|
|
162
|
+
<div id="method-M000051" class="method-detail">
|
|
163
|
+
<a name="M000051"></a>
|
|
164
164
|
|
|
165
165
|
<div class="method-heading">
|
|
166
|
-
<a href="HttpOAuthExtension.src/
|
|
167
|
-
onclick="popupCode('HttpOAuthExtension.src/
|
|
166
|
+
<a href="HttpOAuthExtension.src/M000051.html" target="Code" class="method-signature"
|
|
167
|
+
onclick="popupCode('HttpOAuthExtension.src/M000051.html');return false;">
|
|
168
168
|
<span class="method-name">set_oauth</span><span class="method-args">(controller)</span>
|
|
169
169
|
</a>
|
|
170
170
|
</div>
|
|
@@ -0,0 +1,47 @@
|
|
|
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>requires_oauth (SimpleMapper::HttpOAuthExtension)</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 32</span>
|
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">requires_oauth</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">@consumer_key</span> = <span class="ruby-identifier">consumer_key</span>
|
|
16
|
+
<span class="ruby-ivar">@consumer_secret</span> = <span class="ruby-identifier">consumer_secret</span>
|
|
17
|
+
<span class="ruby-ivar">@oauth_options</span> = <span class="ruby-identifier">options</span> <span class="ruby-operator">||</span> {}
|
|
18
|
+
|
|
19
|
+
<span class="ruby-comment cmt"># Ingeniousity here... ;)</span>
|
|
20
|
+
<span class="ruby-comment cmt"># Duplicates the class to give it a temporary session-attached oauth scope, sets oauth to the Model-Controller-OAuth class,</span>
|
|
21
|
+
<span class="ruby-comment cmt"># then makes the class use the original class for all of its instantiation.</span>
|
|
22
|
+
<span class="ruby-comment cmt"># NOTE: This only really makes the class methods use OAuth. Object methods, like associations, won't play the trick as well.</span>
|
|
23
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">with_oauth</span>(<span class="ruby-identifier">controller</span>)
|
|
24
|
+
<span class="ruby-identifier">duped</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">dup</span>
|
|
25
|
+
<span class="ruby-identifier">duped</span>.<span class="ruby-identifier">set_oauth</span>(<span class="ruby-identifier">controller</span>)
|
|
26
|
+
<span class="ruby-keyword kw">yield</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">block_given?</span>
|
|
27
|
+
<span class="ruby-identifier">duped</span>
|
|
28
|
+
<span class="ruby-keyword kw">end</span>
|
|
29
|
+
|
|
30
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">oauth</span>
|
|
31
|
+
<span class="ruby-ivar">@oauth</span>
|
|
32
|
+
<span class="ruby-keyword kw">end</span>
|
|
33
|
+
|
|
34
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">set_oauth</span>(<span class="ruby-identifier">controller</span>)
|
|
35
|
+
<span class="ruby-ivar">@oauth</span> = <span class="ruby-constant">OAuthController</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">controller</span>, <span class="ruby-keyword kw">self</span>, <span class="ruby-ivar">@consumer_key</span>, <span class="ruby-ivar">@consumer_secret</span>, <span class="ruby-ivar">@oauth_options</span>)
|
|
36
|
+
<span class="ruby-identifier">add_callback</span>(<span class="ruby-value str">'initialize_request'</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">request</span><span class="ruby-operator">|</span>
|
|
37
|
+
<span class="ruby-ivar">@oauth</span>.<span class="ruby-identifier">authenticate!</span> <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-ivar">@oauth</span>.<span class="ruby-identifier">authorized?</span> <span class="ruby-operator">&&</span> <span class="ruby-ivar">@oauth</span>.<span class="ruby-identifier">scriptable?</span>
|
|
38
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-constant">RuntimeError</span>, <span class="ruby-value str">"Must authorize OAuth before attempting to get data from the provider."</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@oauth</span>.<span class="ruby-identifier">authorized?</span>
|
|
39
|
+
<span class="ruby-ivar">@oauth</span>.<span class="ruby-identifier">request_signed!</span>(<span class="ruby-identifier">request</span>)
|
|
40
|
+
<span class="ruby-keyword kw">end</span>
|
|
41
|
+
<span class="ruby-ivar">@oauth</span>
|
|
42
|
+
<span class="ruby-keyword kw">end</span>
|
|
43
|
+
|
|
44
|
+
<span class="ruby-keyword kw">true</span>
|
|
45
|
+
<span class="ruby-keyword kw">end</span></pre>
|
|
46
|
+
</body>
|
|
47
|
+
</html>
|
|
File without changes
|
|
File without changes
|
|
@@ -5,32 +5,12 @@
|
|
|
5
5
|
|
|
6
6
|
<html>
|
|
7
7
|
<head>
|
|
8
|
-
<title>
|
|
8
|
+
<title>set_oauth (SimpleMapper::HttpOAuthExtension)</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">requires_oauth</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">@consumer_key</span> = <span class="ruby-identifier">consumer_key</span>
|
|
16
|
-
<span class="ruby-ivar">@consumer_secret</span> = <span class="ruby-identifier">consumer_secret</span>
|
|
17
|
-
<span class="ruby-ivar">@oauth_options</span> = <span class="ruby-identifier">options</span> <span class="ruby-operator">||</span> {}
|
|
18
|
-
|
|
19
|
-
<span class="ruby-comment cmt"># Ingeniousity here... ;)</span>
|
|
20
|
-
<span class="ruby-comment cmt"># Duplicates the class to give it a temporary session-attached oauth scope, sets oauth to the Model-Controller-OAuth class,</span>
|
|
21
|
-
<span class="ruby-comment cmt"># then makes the class use the original class for all of its instantiation.</span>
|
|
22
|
-
<span class="ruby-comment cmt"># NOTE: This only really makes the class methods use OAuth. Object methods, like associations, won't play the trick as well.</span>
|
|
23
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">with_oauth</span>(<span class="ruby-identifier">controller</span>)
|
|
24
|
-
<span class="ruby-identifier">duped</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">dup</span>
|
|
25
|
-
<span class="ruby-identifier">duped</span>.<span class="ruby-identifier">set_oauth</span>(<span class="ruby-identifier">controller</span>)
|
|
26
|
-
<span class="ruby-keyword kw">yield</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">block_given?</span>
|
|
27
|
-
<span class="ruby-identifier">duped</span>
|
|
28
|
-
<span class="ruby-keyword kw">end</span>
|
|
29
|
-
|
|
30
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">oauth</span>
|
|
31
|
-
<span class="ruby-ivar">@oauth</span>
|
|
32
|
-
<span class="ruby-keyword kw">end</span>
|
|
33
|
-
|
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/simple_mapper/default_plugins/oauth.rb, line 52</span>
|
|
34
14
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">set_oauth</span>(<span class="ruby-identifier">controller</span>)
|
|
35
15
|
<span class="ruby-ivar">@oauth</span> = <span class="ruby-constant">OAuthController</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">controller</span>, <span class="ruby-keyword kw">self</span>, <span class="ruby-ivar">@consumer_key</span>, <span class="ruby-ivar">@consumer_secret</span>, <span class="ruby-ivar">@oauth_options</span>)
|
|
36
16
|
<span class="ruby-identifier">add_callback</span>(<span class="ruby-value str">'initialize_request'</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">request</span><span class="ruby-operator">|</span>
|
|
@@ -39,9 +19,6 @@
|
|
|
39
19
|
<span class="ruby-ivar">@oauth</span>.<span class="ruby-identifier">request_signed!</span>(<span class="ruby-identifier">request</span>)
|
|
40
20
|
<span class="ruby-keyword kw">end</span>
|
|
41
21
|
<span class="ruby-ivar">@oauth</span>
|
|
42
|
-
<span class="ruby-keyword kw">end</span>
|
|
43
|
-
|
|
44
|
-
<span class="ruby-keyword kw">true</span>
|
|
45
|
-
<span class="ruby-keyword kw">end</span></pre>
|
|
22
|
+
<span class="ruby-keyword kw">end</span></pre>
|
|
46
23
|
</body>
|
|
47
24
|
</html>
|