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
data/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2008 Daniel Parker
1
+ Copyright (c) 2008 BehindLogic
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining a copy of this software
4
4
  and associated documentation files (the "Software"), to deal in the Software without restriction,
data/README CHANGED
@@ -0,0 +1,16 @@
1
+ == SimpleMapper
2
+
3
+ The purpose of this is to provide Ruby models with Persistence in the simplest way possible.
4
+ Like all ORM's it must be based on two components: Format and Connection. The aim is to stay out of the way
5
+ as much as possible: Format will be performed by calling, for example a Person class using the xml format:
6
+ '@person.to_xml', and likewise 'Person.from_xml'.
7
+
8
+ SimpleMapper will hold no concept of primary keys or even of properties or attributes. It will be data-agnostic.
9
+ It will simply handle the transformation and communication of data while providing a common method interface
10
+ in order to remove the model from the persistence.
11
+
12
+ The connection class will simply work with the idea of messages sent by adapters. All adapters must respond to these methods
13
+ appropriately: get, put, post, and delete. These correspond directly to HTTP methods, and correspond to SQL commands
14
+ in the order of SELECT, UPDATE, INSERT, and DELETE. It is up to an extraneous library/gem to handle conversions of special
15
+ "finder" options, like converting an options hash to a sql SELECT request, or mapping an options hash to an HTTP request.
16
+ It is purposed to make it as light and simple as possible to plug these in.
data/Rakefile CHANGED
@@ -6,7 +6,7 @@ require 'rake/gempackagetask'
6
6
  require 'rake/contrib/rubyforgepublisher'
7
7
 
8
8
  PKG_NAME = 'simplemapper'
9
- PKG_VERSION = "0.0.1"
9
+ PKG_VERSION = "0.0.2"
10
10
 
11
11
  PKG_FILES = FileList[
12
12
  "lib/**/*", "rspec/**/*", "[A-Z]*", "Rakefile", "doc/**/*"
@@ -55,6 +55,10 @@
55
55
  <tr class="top-aligned-row">
56
56
  <td><strong>In:</strong></td>
57
57
  <td>
58
+ <a href="../files/lib/simple_mapper/default_plugins/options_to_query_rb.html">
59
+ lib/simple_mapper/default_plugins/options_to_query.rb
60
+ </a>
61
+ <br />
58
62
  <a href="../files/lib/simple_mapper/support/core_ext_rb.html">
59
63
  lib/simple_mapper/support/core_ext.rb
60
64
  </a>
@@ -88,7 +92,8 @@
88
92
  <h3 class="section-bar">Methods</h3>
89
93
 
90
94
  <div class="name-list">
91
- <a href="#M000001">crawl</a>&nbsp;&nbsp;
95
+ <a href="#M000006">crawl</a>&nbsp;&nbsp;
96
+ <a href="#M000005">except</a>&nbsp;&nbsp;
92
97
  </div>
93
98
  </div>
94
99
 
@@ -110,12 +115,12 @@
110
115
  <div id="methods">
111
116
  <h3 class="section-bar">Public Instance methods</h3>
112
117
 
113
- <div id="method-M000001" class="method-detail">
114
- <a name="M000001"></a>
118
+ <div id="method-M000006" class="method-detail">
119
+ <a name="M000006"></a>
115
120
 
116
121
  <div class="method-heading">
117
- <a href="Array.src/M000001.html" target="Code" class="method-signature"
118
- onclick="popupCode('Array.src/M000001.html');return false;">
122
+ <a href="Array.src/M000006.html" target="Code" class="method-signature"
123
+ onclick="popupCode('Array.src/M000006.html');return false;">
119
124
  <span class="method-name">crawl</span><span class="method-args">() {|v| ...}</span>
120
125
  </a>
121
126
  </div>
@@ -124,6 +129,20 @@
124
129
  </div>
125
130
  </div>
126
131
 
132
+ <div id="method-M000005" class="method-detail">
133
+ <a name="M000005"></a>
134
+
135
+ <div class="method-heading">
136
+ <a href="Array.src/M000005.html" target="Code" class="method-signature"
137
+ onclick="popupCode('Array.src/M000005.html');return false;">
138
+ <span class="method-name">except</span><span class="method-args">(element)</span>
139
+ </a>
140
+ </div>
141
+
142
+ <div class="method-description">
143
+ </div>
144
+ </div>
145
+
127
146
 
128
147
  </div>
129
148
 
@@ -5,18 +5,14 @@
5
5
 
6
6
  <html>
7
7
  <head>
8
- <title>inflections (Inflector)</title>
8
+ <title>except (Array)</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 82</span>
14
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">inflections</span>
15
- <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">block_given?</span>
16
- <span class="ruby-keyword kw">yield</span> <span class="ruby-constant">Inflections</span>.<span class="ruby-identifier">instance</span>
17
- <span class="ruby-keyword kw">else</span>
18
- <span class="ruby-constant">Inflections</span>.<span class="ruby-identifier">instance</span>
19
- <span class="ruby-keyword kw">end</span>
13
+ <pre><span class="ruby-comment cmt"># File lib/simple_mapper/support/core_ext.rb, line 45</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">except</span>(<span class="ruby-identifier">element</span>)
15
+ <span class="ruby-identifier">reject</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">e</span><span class="ruby-operator">|</span> <span class="ruby-identifier">e</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">element</span>}
20
16
  <span class="ruby-keyword kw">end</span></pre>
21
17
  </body>
22
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/support/core_ext.rb, line 45</span>
13
+ <pre><span class="ruby-comment cmt"># File lib/simple_mapper/support/core_ext.rb, line 49</span>
14
14
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">crawl</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">ArgumentError</span>, <span class="ruby-value str">&quot;no block given&quot;</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">block_given?</span>
16
16
  <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">v</span><span class="ruby-operator">|</span>
@@ -80,9 +80,9 @@
80
80
  <h3 class="section-bar">Methods</h3>
81
81
 
82
82
  <div class="name-list">
83
- <a href="#M000038">add_callback</a>&nbsp;&nbsp;
84
- <a href="#M000037">callbacks</a>&nbsp;&nbsp;
85
- <a href="#M000039">run_callback</a>&nbsp;&nbsp;
83
+ <a href="#M000041">add_callback</a>&nbsp;&nbsp;
84
+ <a href="#M000040">callbacks</a>&nbsp;&nbsp;
85
+ <a href="#M000042">run_callback</a>&nbsp;&nbsp;
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-M000038" class="method-detail">
108
- <a name="M000038"></a>
107
+ <div id="method-M000041" class="method-detail">
108
+ <a name="M000041"></a>
109
109
 
110
110
  <div class="method-heading">
111
- <a href="Callbacks.src/M000038.html" target="Code" class="method-signature"
112
- onclick="popupCode('Callbacks.src/M000038.html');return false;">
111
+ <a href="Callbacks.src/M000041.html" target="Code" class="method-signature"
112
+ onclick="popupCode('Callbacks.src/M000041.html');return false;">
113
113
  <span class="method-name">add_callback</span><span class="method-args">(name,&amp;block)</span>
114
114
  </a>
115
115
  </div>
@@ -118,12 +118,12 @@
118
118
  </div>
119
119
  </div>
120
120
 
121
- <div id="method-M000037" class="method-detail">
122
- <a name="M000037"></a>
121
+ <div id="method-M000040" class="method-detail">
122
+ <a name="M000040"></a>
123
123
 
124
124
  <div class="method-heading">
125
- <a href="Callbacks.src/M000037.html" target="Code" class="method-signature"
126
- onclick="popupCode('Callbacks.src/M000037.html');return false;">
125
+ <a href="Callbacks.src/M000040.html" target="Code" class="method-signature"
126
+ onclick="popupCode('Callbacks.src/M000040.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-M000039" class="method-detail">
136
- <a name="M000039"></a>
135
+ <div id="method-M000042" class="method-detail">
136
+ <a name="M000042"></a>
137
137
 
138
138
  <div class="method-heading">
139
- <a href="Callbacks.src/M000039.html" target="Code" class="method-signature"
140
- onclick="popupCode('Callbacks.src/M000039.html');return false;">
139
+ <a href="Callbacks.src/M000042.html" target="Code" class="method-signature"
140
+ onclick="popupCode('Callbacks.src/M000042.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>
@@ -80,7 +80,7 @@
80
80
  <h3 class="section-bar">Methods</h3>
81
81
 
82
82
  <div class="name-list">
83
- <a href="#M000040">group_by</a>&nbsp;&nbsp;
83
+ <a href="#M000043">group_by</a>&nbsp;&nbsp;
84
84
  </div>
85
85
  </div>
86
86
 
@@ -102,12 +102,12 @@
102
102
  <div id="methods">
103
103
  <h3 class="section-bar">Public Instance methods</h3>
104
104
 
105
- <div id="method-M000040" class="method-detail">
106
- <a name="M000040"></a>
105
+ <div id="method-M000043" class="method-detail">
106
+ <a name="M000043"></a>
107
107
 
108
108
  <div class="method-heading">
109
- <a href="Enumerable.src/M000040.html" target="Code" class="method-signature"
110
- onclick="popupCode('Enumerable.src/M000040.html');return false;">
109
+ <a href="Enumerable.src/M000043.html" target="Code" class="method-signature"
110
+ onclick="popupCode('Enumerable.src/M000043.html');return false;">
111
111
  <span class="method-name">group_by</span><span class="method-args">() {|element| ...}</span>
112
112
  </a>
113
113
  </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/core_ext.rb, line 67</span>
13
+ <pre><span class="ruby-comment cmt"># File lib/simple_mapper/support/core_ext.rb, line 71</span>
14
14
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">group_by</span>
15
15
  <span class="ruby-identifier">inject</span>({}) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">groups</span>, <span class="ruby-identifier">element</span><span class="ruby-operator">|</span>
16
16
  (<span class="ruby-identifier">groups</span>[<span class="ruby-keyword kw">yield</span>(<span class="ruby-identifier">element</span>)] <span class="ruby-operator">||=</span> []) <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">element</span>
@@ -55,6 +55,10 @@
55
55
  <tr class="top-aligned-row">
56
56
  <td><strong>In:</strong></td>
57
57
  <td>
58
+ <a href="../files/lib/simple_mapper/default_plugins/options_to_query_rb.html">
59
+ lib/simple_mapper/default_plugins/options_to_query.rb
60
+ </a>
61
+ <br />
58
62
  <a href="../files/lib/simple_mapper/support/core_ext_rb.html">
59
63
  lib/simple_mapper/support/core_ext.rb
60
64
  </a>
@@ -88,8 +92,9 @@
88
92
  <h3 class="section-bar">Methods</h3>
89
93
 
90
94
  <div class="name-list">
91
- <a href="#M000003">crawl</a>&nbsp;&nbsp;
92
- <a href="#M000002">stringify_keys!</a>&nbsp;&nbsp;
95
+ <a href="#M000004">crawl</a>&nbsp;&nbsp;
96
+ <a href="#M000003">stringify_keys!</a>&nbsp;&nbsp;
97
+ <a href="#M000002">to_query</a>&nbsp;&nbsp;
93
98
  </div>
94
99
  </div>
95
100
 
@@ -111,13 +116,27 @@
111
116
  <div id="methods">
112
117
  <h3 class="section-bar">Public Instance methods</h3>
113
118
 
119
+ <div id="method-M000004" class="method-detail">
120
+ <a name="M000004"></a>
121
+
122
+ <div class="method-heading">
123
+ <a href="Hash.src/M000004.html" target="Code" class="method-signature"
124
+ onclick="popupCode('Hash.src/M000004.html');return false;">
125
+ <span class="method-name">crawl</span><span class="method-args">() {|v| ...}</span>
126
+ </a>
127
+ </div>
128
+
129
+ <div class="method-description">
130
+ </div>
131
+ </div>
132
+
114
133
  <div id="method-M000003" class="method-detail">
115
134
  <a name="M000003"></a>
116
135
 
117
136
  <div class="method-heading">
118
137
  <a href="Hash.src/M000003.html" target="Code" class="method-signature"
119
138
  onclick="popupCode('Hash.src/M000003.html');return false;">
120
- <span class="method-name">crawl</span><span class="method-args">() {|v| ...}</span>
139
+ <span class="method-name">stringify_keys!</span><span class="method-args">()</span>
121
140
  </a>
122
141
  </div>
123
142
 
@@ -131,7 +150,7 @@
131
150
  <div class="method-heading">
132
151
  <a href="Hash.src/M000002.html" target="Code" class="method-signature"
133
152
  onclick="popupCode('Hash.src/M000002.html');return false;">
134
- <span class="method-name">stringify_keys!</span><span class="method-args">()</span>
153
+ <span class="method-name">to_query</span><span class="method-args">(namespace=nil)</span>
135
154
  </a>
136
155
  </div>
137
156
 
@@ -5,14 +5,16 @@
5
5
 
6
6
  <html>
7
7
  <head>
8
- <title>stringify_keys! (Hash)</title>
8
+ <title>to_query (Hash)</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/core_ext.rb, line 19</span>
14
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">stringify_keys!</span>
15
- <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">each_key</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">k</span><span class="ruby-operator">|</span> <span class="ruby-keyword kw">self</span>[<span class="ruby-identifier">k</span>.<span class="ruby-identifier">to_s</span>] = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-identifier">k</span>)}
13
+ <pre><span class="ruby-comment cmt"># File lib/simple_mapper/default_plugins/options_to_query.rb, line 18</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_query</span>(<span class="ruby-identifier">namespace</span>=<span class="ruby-keyword kw">nil</span>)
15
+ <span class="ruby-identifier">collect</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">key</span>, <span class="ruby-identifier">value</span><span class="ruby-operator">|</span>
16
+ <span class="ruby-identifier">value</span>.<span class="ruby-identifier">to_query</span>(<span class="ruby-identifier">namespace</span> <span class="ruby-value">? </span><span class="ruby-node">&quot;#{namespace}[#{key}]&quot;</span> <span class="ruby-operator">:</span> <span class="ruby-identifier">key</span>)
17
+ <span class="ruby-keyword kw">end</span> <span class="ruby-operator">*</span> <span class="ruby-value str">'&amp;'</span>
16
18
  <span class="ruby-keyword kw">end</span></pre>
17
19
  </body>
18
20
  </html>
@@ -5,30 +5,14 @@
5
5
 
6
6
  <html>
7
7
  <head>
8
- <title>crawl (Hash)</title>
8
+ <title>stringify_keys! (Hash)</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/core_ext.rb, line 23</span>
14
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">crawl</span>(<span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
15
- <span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-value str">&quot;no block given&quot;</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">block_given?</span>
16
- <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">k</span>,<span class="ruby-identifier">v</span><span class="ruby-operator">|</span>
17
- <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">block</span>.<span class="ruby-identifier">arity</span>
18
- <span class="ruby-keyword kw">when</span> <span class="ruby-value">1</span>
19
- <span class="ruby-keyword kw">yield</span>(<span class="ruby-identifier">v</span>)
20
- <span class="ruby-keyword kw">when</span> <span class="ruby-value">2</span>
21
- <span class="ruby-keyword kw">yield</span>(<span class="ruby-identifier">k</span>,<span class="ruby-identifier">v</span>)
22
- <span class="ruby-keyword kw">when</span> <span class="ruby-value">3</span>
23
- <span class="ruby-keyword kw">yield</span>(<span class="ruby-keyword kw">self</span>,<span class="ruby-identifier">k</span>,<span class="ruby-identifier">v</span>)
24
- <span class="ruby-identifier">v</span> = <span class="ruby-keyword kw">self</span>[<span class="ruby-identifier">k</span>]
25
- <span class="ruby-keyword kw">end</span>
26
- <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">v</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Array</span>)
27
- <span class="ruby-identifier">v</span>.<span class="ruby-identifier">crawl</span>(<span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
28
- <span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">v</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Hash</span>)
29
- <span class="ruby-identifier">v</span>.<span class="ruby-identifier">crawl</span>(<span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
30
- <span class="ruby-keyword kw">end</span>
31
- <span class="ruby-keyword kw">end</span>
13
+ <pre><span class="ruby-comment cmt"># File lib/simple_mapper/support/core_ext.rb, line 19</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">stringify_keys!</span>
15
+ <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">each_key</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">k</span><span class="ruby-operator">|</span> <span class="ruby-keyword kw">self</span>[<span class="ruby-identifier">k</span>.<span class="ruby-identifier">to_s</span>] = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-identifier">k</span>)}
32
16
  <span class="ruby-keyword kw">end</span></pre>
33
17
  </body>
34
18
  </html>
@@ -0,0 +1,34 @@
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>crawl (Hash)</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/core_ext.rb, line 23</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">crawl</span>(<span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
15
+ <span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-value str">&quot;no block given&quot;</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">block_given?</span>
16
+ <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">k</span>,<span class="ruby-identifier">v</span><span class="ruby-operator">|</span>
17
+ <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">block</span>.<span class="ruby-identifier">arity</span>
18
+ <span class="ruby-keyword kw">when</span> <span class="ruby-value">1</span>
19
+ <span class="ruby-keyword kw">yield</span>(<span class="ruby-identifier">v</span>)
20
+ <span class="ruby-keyword kw">when</span> <span class="ruby-value">2</span>
21
+ <span class="ruby-keyword kw">yield</span>(<span class="ruby-identifier">k</span>,<span class="ruby-identifier">v</span>)
22
+ <span class="ruby-keyword kw">when</span> <span class="ruby-value">3</span>
23
+ <span class="ruby-keyword kw">yield</span>(<span class="ruby-keyword kw">self</span>,<span class="ruby-identifier">k</span>,<span class="ruby-identifier">v</span>)
24
+ <span class="ruby-identifier">v</span> = <span class="ruby-keyword kw">self</span>[<span class="ruby-identifier">k</span>]
25
+ <span class="ruby-keyword kw">end</span>
26
+ <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">v</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Array</span>)
27
+ <span class="ruby-identifier">v</span>.<span class="ruby-identifier">crawl</span>(<span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
28
+ <span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">v</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Hash</span>)
29
+ <span class="ruby-identifier">v</span>.<span class="ruby-identifier">crawl</span>(<span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
30
+ <span class="ruby-keyword kw">end</span>
31
+ <span class="ruby-keyword kw">end</span>
32
+ <span class="ruby-keyword kw">end</span></pre>
33
+ </body>
34
+ </html>
@@ -83,7 +83,7 @@
83
83
  <div id="description">
84
84
  <p>
85
85
  A singleton instance of this class is yielded by <a
86
- href="../Inflector.html#M000017">Inflector.inflections</a>, which can then
86
+ href="../Inflector.html#M000020">Inflector.inflections</a>, which can then
87
87
  be used to specify additional inflection rules. Examples:
88
88
  </p>
89
89
  <pre>
@@ -98,7 +98,7 @@ be used to specify additional inflection rules. Examples:
98
98
  </pre>
99
99
  <p>
100
100
  New rules are added at the top. So in the example above, the <a
101
- href="Inflections.html#M000034">irregular</a> rule for octopus will now be
101
+ href="Inflections.html#M000037">irregular</a> rule for octopus will now be
102
102
  the first of the pluralization and singularization rules that is runs. This
103
103
  guarantees that your rules run before any of the rules that may already
104
104
  have been loaded.
@@ -113,12 +113,12 @@ have been loaded.
113
113
  <h3 class="section-bar">Methods</h3>
114
114
 
115
115
  <div class="name-list">
116
- <a href="#M000036">clear</a>&nbsp;&nbsp;
117
- <a href="#M000034">irregular</a>&nbsp;&nbsp;
118
- <a href="#M000031">new</a>&nbsp;&nbsp;
119
- <a href="#M000032">plural</a>&nbsp;&nbsp;
120
- <a href="#M000033">singular</a>&nbsp;&nbsp;
121
- <a href="#M000035">uncountable</a>&nbsp;&nbsp;
116
+ <a href="#M000039">clear</a>&nbsp;&nbsp;
117
+ <a href="#M000037">irregular</a>&nbsp;&nbsp;
118
+ <a href="#M000034">new</a>&nbsp;&nbsp;
119
+ <a href="#M000035">plural</a>&nbsp;&nbsp;
120
+ <a href="#M000036">singular</a>&nbsp;&nbsp;
121
+ <a href="#M000038">uncountable</a>&nbsp;&nbsp;
122
122
  </div>
123
123
  </div>
124
124
 
@@ -170,12 +170,12 @@ have been loaded.
170
170
  <div id="methods">
171
171
  <h3 class="section-bar">Public Class methods</h3>
172
172
 
173
- <div id="method-M000031" class="method-detail">
174
- <a name="M000031"></a>
173
+ <div id="method-M000034" class="method-detail">
174
+ <a name="M000034"></a>
175
175
 
176
176
  <div class="method-heading">
177
- <a href="Inflections.src/M000031.html" target="Code" class="method-signature"
178
- onclick="popupCode('Inflections.src/M000031.html');return false;">
177
+ <a href="Inflections.src/M000034.html" target="Code" class="method-signature"
178
+ onclick="popupCode('Inflections.src/M000034.html');return false;">
179
179
  <span class="method-name">new</span><span class="method-args">()</span>
180
180
  </a>
181
181
  </div>
@@ -186,12 +186,12 @@ have been loaded.
186
186
 
187
187
  <h3 class="section-bar">Public Instance methods</h3>
188
188
 
189
- <div id="method-M000036" class="method-detail">
190
- <a name="M000036"></a>
189
+ <div id="method-M000039" class="method-detail">
190
+ <a name="M000039"></a>
191
191
 
192
192
  <div class="method-heading">
193
- <a href="Inflections.src/M000036.html" target="Code" class="method-signature"
194
- onclick="popupCode('Inflections.src/M000036.html');return false;">
193
+ <a href="Inflections.src/M000039.html" target="Code" class="method-signature"
194
+ onclick="popupCode('Inflections.src/M000039.html');return false;">
195
195
  <span class="method-name">clear</span><span class="method-args">(scope = :all)</span>
196
196
  </a>
197
197
  </div>
@@ -212,25 +212,25 @@ Examples:
212
212
  </div>
213
213
  </div>
214
214
 
215
- <div id="method-M000034" class="method-detail">
216
- <a name="M000034"></a>
215
+ <div id="method-M000037" class="method-detail">
216
+ <a name="M000037"></a>
217
217
 
218
218
  <div class="method-heading">
219
- <a href="Inflections.src/M000034.html" target="Code" class="method-signature"
220
- onclick="popupCode('Inflections.src/M000034.html');return false;">
219
+ <a href="Inflections.src/M000037.html" target="Code" class="method-signature"
220
+ onclick="popupCode('Inflections.src/M000037.html');return false;">
221
221
  <span class="method-name">irregular</span><span class="method-args">(singular, plural)</span>
222
222
  </a>
223
223
  </div>
224
224
 
225
225
  <div class="method-description">
226
226
  <p>
227
- Specifies a <a href="Inflections.html#M000031">new</a> <a
228
- href="Inflections.html#M000034">irregular</a> that applies to both
227
+ Specifies a <a href="Inflections.html#M000034">new</a> <a
228
+ href="Inflections.html#M000037">irregular</a> that applies to both
229
229
  pluralization and singularization at the same time. This can only be used
230
230
  for strings, not regular expressions. You simply pass the <a
231
- href="Inflections.html#M000034">irregular</a> in <a
232
- href="Inflections.html#M000033">singular</a> and <a
233
- href="Inflections.html#M000032">plural</a> form.
231
+ href="Inflections.html#M000037">irregular</a> in <a
232
+ href="Inflections.html#M000036">singular</a> and <a
233
+ href="Inflections.html#M000035">plural</a> form.
234
234
  </p>
235
235
  <p>
236
236
  Examples:
@@ -242,19 +242,19 @@ Examples:
242
242
  </div>
243
243
  </div>
244
244
 
245
- <div id="method-M000032" class="method-detail">
246
- <a name="M000032"></a>
245
+ <div id="method-M000035" class="method-detail">
246
+ <a name="M000035"></a>
247
247
 
248
248
  <div class="method-heading">
249
- <a href="Inflections.src/M000032.html" target="Code" class="method-signature"
250
- onclick="popupCode('Inflections.src/M000032.html');return false;">
249
+ <a href="Inflections.src/M000035.html" target="Code" class="method-signature"
250
+ onclick="popupCode('Inflections.src/M000035.html');return false;">
251
251
  <span class="method-name">plural</span><span class="method-args">(rule, replacement)</span>
252
252
  </a>
253
253
  </div>
254
254
 
255
255
  <div class="method-description">
256
256
  <p>
257
- Specifies a <a href="Inflections.html#M000031">new</a> pluralization rule
257
+ Specifies a <a href="Inflections.html#M000034">new</a> pluralization rule
258
258
  and its replacement. The rule can either be a string or a regular
259
259
  expression. The replacement should always be a string that may include
260
260
  references to the matched data from the rule.
@@ -262,19 +262,19 @@ references to the matched data from the rule.
262
262
  </div>
263
263
  </div>
264
264
 
265
- <div id="method-M000033" class="method-detail">
266
- <a name="M000033"></a>
265
+ <div id="method-M000036" class="method-detail">
266
+ <a name="M000036"></a>
267
267
 
268
268
  <div class="method-heading">
269
- <a href="Inflections.src/M000033.html" target="Code" class="method-signature"
270
- onclick="popupCode('Inflections.src/M000033.html');return false;">
269
+ <a href="Inflections.src/M000036.html" target="Code" class="method-signature"
270
+ onclick="popupCode('Inflections.src/M000036.html');return false;">
271
271
  <span class="method-name">singular</span><span class="method-args">(rule, replacement)</span>
272
272
  </a>
273
273
  </div>
274
274
 
275
275
  <div class="method-description">
276
276
  <p>
277
- Specifies a <a href="Inflections.html#M000031">new</a> singularization rule
277
+ Specifies a <a href="Inflections.html#M000034">new</a> singularization rule
278
278
  and its replacement. The rule can either be a string or a regular
279
279
  expression. The replacement should always be a string that may include
280
280
  references to the matched data from the rule.
@@ -282,19 +282,19 @@ references to the matched data from the rule.
282
282
  </div>
283
283
  </div>
284
284
 
285
- <div id="method-M000035" class="method-detail">
286
- <a name="M000035"></a>
285
+ <div id="method-M000038" class="method-detail">
286
+ <a name="M000038"></a>
287
287
 
288
288
  <div class="method-heading">
289
- <a href="Inflections.src/M000035.html" target="Code" class="method-signature"
290
- onclick="popupCode('Inflections.src/M000035.html');return false;">
289
+ <a href="Inflections.src/M000038.html" target="Code" class="method-signature"
290
+ onclick="popupCode('Inflections.src/M000038.html');return false;">
291
291
  <span class="method-name">uncountable</span><span class="method-args">(*words)</span>
292
292
  </a>
293
293
  </div>
294
294
 
295
295
  <div class="method-description">
296
296
  <p>
297
- Add <a href="Inflections.html#M000035">uncountable</a> words that
297
+ Add <a href="Inflections.html#M000038">uncountable</a> words that
298
298
  shouldn&#8216;t be attempted inflected.
299
299
  </p>
300
300
  <p>
@@ -5,15 +5,14 @@
5
5
 
6
6
  <html>
7
7
  <head>
8
- <title>irregular (Inflector::Inflections)</title>
8
+ <title>new (Inflector::Inflections)</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 49</span>
14
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">irregular</span>(<span class="ruby-identifier">singular</span>, <span class="ruby-identifier">plural</span>)
15
- <span class="ruby-identifier">plural</span>(<span class="ruby-constant">Regexp</span>.<span class="ruby-identifier">new</span>(<span class="ruby-node">&quot;(#{singular[0,1]})#{singular[1..-1]}$&quot;</span>, <span class="ruby-value str">&quot;i&quot;</span>), <span class="ruby-value str">'\1'</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">plural</span>[<span class="ruby-value">1</span><span class="ruby-operator">..</span><span class="ruby-value">-1</span>])
16
- <span class="ruby-identifier">singular</span>(<span class="ruby-constant">Regexp</span>.<span class="ruby-identifier">new</span>(<span class="ruby-node">&quot;(#{plural[0,1]})#{plural[1..-1]}$&quot;</span>, <span class="ruby-value str">&quot;i&quot;</span>), <span class="ruby-value str">'\1'</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">singular</span>[<span class="ruby-value">1</span><span class="ruby-operator">..</span><span class="ruby-value">-1</span>])
13
+ <pre><span class="ruby-comment cmt"># File lib/simple_mapper/support/inflector.rb, line 27</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>
15
+ <span class="ruby-ivar">@plurals</span>, <span class="ruby-ivar">@singulars</span>, <span class="ruby-ivar">@uncountables</span> = [], [], []
17
16
  <span class="ruby-keyword kw">end</span></pre>
18
17
  </body>
19
18
  </html>