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
@@ -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>
@@ -80,6 +84,14 @@
80
84
 
81
85
  <div id="contextContent">
82
86
 
87
+ <div id="description">
88
+ <p>
89
+ This simply defines some extensions to various objects to enable smartly
90
+ converting values to a standard query string understandable by Rails and <a
91
+ href="Merb.html">Merb</a>. First the structural base:
92
+ </p>
93
+
94
+ </div>
83
95
 
84
96
 
85
97
  </div>
@@ -88,7 +100,7 @@
88
100
  <h3 class="section-bar">Methods</h3>
89
101
 
90
102
  <div class="name-list">
91
- <a href="#M000010">extended</a>&nbsp;&nbsp;
103
+ <a href="#M000013">extended</a>&nbsp;&nbsp;
92
104
  </div>
93
105
  </div>
94
106
 
@@ -110,13 +122,13 @@
110
122
  <div id="methods">
111
123
  <h3 class="section-bar">Public Instance methods</h3>
112
124
 
113
- <div id="method-M000010" class="method-detail">
114
- <a name="M000010"></a>
125
+ <div id="method-M000013" class="method-detail">
126
+ <a name="M000013"></a>
115
127
 
116
128
  <div class="method-heading">
117
- <a href="Object.src/M000010.html" target="Code" class="method-signature"
118
- onclick="popupCode('Object.src/M000010.html');return false;">
119
- <span class="method-name">extended</span><span class="method-args">(&amp;block)</span>
129
+ <a href="Object.src/M000013.html" target="Code" class="method-signature"
130
+ onclick="popupCode('Object.src/M000013.html');return false;">
131
+ <span class="method-name">extended</span><span class="method-args">(*args, &amp;block)</span>
120
132
  </a>
121
133
  </div>
122
134
 
@@ -11,8 +11,8 @@
11
11
  </head>
12
12
  <body class="standalone-code">
13
13
  <pre><span class="ruby-comment cmt"># File lib/simple_mapper/support/core_ext.rb, line 5</span>
14
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">extended</span>(<span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
15
- <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">send</span>(<span class="ruby-identifier">:eval</span>, <span class="ruby-identifier">block</span>.<span class="ruby-identifier">to_ruby</span>).<span class="ruby-identifier">call</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">extended</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
15
+ <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">send</span>(<span class="ruby-identifier">:eval</span>, <span class="ruby-identifier">block</span>.<span class="ruby-identifier">to_ruby</span>).<span class="ruby-identifier">call</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>)
16
16
  <span class="ruby-keyword kw">self</span>
17
17
  <span class="ruby-keyword kw">end</span></pre>
18
18
  </body>
@@ -88,7 +88,7 @@
88
88
  <h3 class="section-bar">Methods</h3>
89
89
 
90
90
  <div class="name-list">
91
- <a href="#M000004">in_context</a>&nbsp;&nbsp;
91
+ <a href="#M000007">in_context</a>&nbsp;&nbsp;
92
92
  </div>
93
93
  </div>
94
94
 
@@ -110,12 +110,12 @@
110
110
  <div id="methods">
111
111
  <h3 class="section-bar">Public Instance methods</h3>
112
112
 
113
- <div id="method-M000004" class="method-detail">
114
- <a name="M000004"></a>
113
+ <div id="method-M000007" class="method-detail">
114
+ <a name="M000007"></a>
115
115
 
116
116
  <div class="method-heading">
117
- <a href="Proc.src/M000004.html" target="Code" class="method-signature"
118
- onclick="popupCode('Proc.src/M000004.html');return false;">
117
+ <a href="Proc.src/M000007.html" target="Code" class="method-signature"
118
+ onclick="popupCode('Proc.src/M000007.html');return false;">
119
119
  <span class="method-name">in_context</span><span class="method-args">(klass_or_obj)</span>
120
120
  </a>
121
121
  </div>
File without changes
@@ -80,10 +80,10 @@
80
80
  <h3 class="section-bar">Methods</h3>
81
81
 
82
82
  <div class="name-list">
83
- <a href="#M000016">hash_from_xml</a>&nbsp;&nbsp;
84
- <a href="#M000013">object_to_xml</a>&nbsp;&nbsp;
85
- <a href="#M000015">to_string</a>&nbsp;&nbsp;
86
- <a href="#M000014">to_xml</a>&nbsp;&nbsp;
83
+ <a href="#M000019">hash_from_xml</a>&nbsp;&nbsp;
84
+ <a href="#M000016">object_to_xml</a>&nbsp;&nbsp;
85
+ <a href="#M000018">to_string</a>&nbsp;&nbsp;
86
+ <a href="#M000017">to_xml</a>&nbsp;&nbsp;
87
87
  </div>
88
88
  </div>
89
89
 
@@ -118,12 +118,12 @@
118
118
  <div id="methods">
119
119
  <h3 class="section-bar">Public Class methods</h3>
120
120
 
121
- <div id="method-M000016" class="method-detail">
122
- <a name="M000016"></a>
121
+ <div id="method-M000019" class="method-detail">
122
+ <a name="M000019"></a>
123
123
 
124
124
  <div class="method-heading">
125
- <a href="Serialize.src/M000016.html" target="Code" class="method-signature"
126
- onclick="popupCode('Serialize.src/M000016.html');return false;">
125
+ <a href="Serialize.src/M000019.html" target="Code" class="method-signature"
126
+ onclick="popupCode('Serialize.src/M000019.html');return false;">
127
127
  <span class="method-name">hash_from_xml</span><span class="method-args">(xml,options={})</span>
128
128
  </a>
129
129
  </div>
@@ -132,12 +132,12 @@
132
132
  </div>
133
133
  </div>
134
134
 
135
- <div id="method-M000013" class="method-detail">
136
- <a name="M000013"></a>
135
+ <div id="method-M000016" class="method-detail">
136
+ <a name="M000016"></a>
137
137
 
138
138
  <div class="method-heading">
139
- <a href="Serialize.src/M000013.html" target="Code" class="method-signature"
140
- onclick="popupCode('Serialize.src/M000013.html');return false;">
139
+ <a href="Serialize.src/M000016.html" target="Code" class="method-signature"
140
+ onclick="popupCode('Serialize.src/M000016.html');return false;">
141
141
  <span class="method-name">object_to_xml</span><span class="method-args">(obj, options={})</span>
142
142
  </a>
143
143
  </div>
@@ -146,12 +146,12 @@
146
146
  </div>
147
147
  </div>
148
148
 
149
- <div id="method-M000015" class="method-detail">
150
- <a name="M000015"></a>
149
+ <div id="method-M000018" class="method-detail">
150
+ <a name="M000018"></a>
151
151
 
152
152
  <div class="method-heading">
153
- <a href="Serialize.src/M000015.html" target="Code" class="method-signature"
154
- onclick="popupCode('Serialize.src/M000015.html');return false;">
153
+ <a href="Serialize.src/M000018.html" target="Code" class="method-signature"
154
+ onclick="popupCode('Serialize.src/M000018.html');return false;">
155
155
  <span class="method-name">to_string</span><span class="method-args">()</span>
156
156
  </a>
157
157
  </div>
@@ -160,12 +160,12 @@
160
160
  </div>
161
161
  </div>
162
162
 
163
- <div id="method-M000014" class="method-detail">
164
- <a name="M000014"></a>
163
+ <div id="method-M000017" class="method-detail">
164
+ <a name="M000017"></a>
165
165
 
166
166
  <div class="method-heading">
167
- <a href="Serialize.src/M000014.html" target="Code" class="method-signature"
168
- onclick="popupCode('Serialize.src/M000014.html');return false;">
167
+ <a href="Serialize.src/M000017.html" target="Code" class="method-signature"
168
+ onclick="popupCode('Serialize.src/M000017.html');return false;">
169
169
  <span class="method-name">to_xml</span><span class="method-args">(root, attributes={}, options={})</span>
170
170
  </a>
171
171
  </div>
@@ -5,42 +5,17 @@
5
5
 
6
6
  <html>
7
7
  <head>
8
- <title>hash_from_xml (Serialize)</title>
8
+ <title>object_to_xml (Serialize)</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/bliss_serializer.rb, line 125</span>
14
- <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">hash_from_xml</span>(<span class="ruby-identifier">xml</span>,<span class="ruby-identifier">options</span>={})
15
- <span class="ruby-identifier">options</span> = <span class="ruby-constant">XML_OPTIONS</span>.<span class="ruby-identifier">merge</span>(<span class="ruby-identifier">options</span>)
16
-
17
- <span class="ruby-identifier">stack</span> = []
18
- <span class="ruby-identifier">parser</span> = <span class="ruby-constant">REXML</span><span class="ruby-operator">::</span><span class="ruby-constant">Parsers</span><span class="ruby-operator">::</span><span class="ruby-constant">BaseParser</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">xml</span>)
19
-
20
- <span class="ruby-keyword kw">while</span> <span class="ruby-keyword kw">true</span>
21
- <span class="ruby-identifier">event</span> = <span class="ruby-identifier">parser</span>.<span class="ruby-identifier">pull</span>
22
- <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">event</span>[<span class="ruby-value">0</span>]
23
- <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:end_document</span>
24
- <span class="ruby-keyword kw">break</span>
25
- <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:end_doctype</span>, <span class="ruby-identifier">:start_doctype</span>
26
- <span class="ruby-comment cmt"># do nothing</span>
27
- <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:start_element</span>
28
- <span class="ruby-identifier">stack</span>.<span class="ruby-identifier">push</span> <span class="ruby-constant">REXMLUtilityNode</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">event</span>[<span class="ruby-value">1</span>], <span class="ruby-identifier">event</span>[<span class="ruby-value">2</span>])
29
- <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:end_element</span>
30
- <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">stack</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">1</span>
31
- <span class="ruby-identifier">temp</span> = <span class="ruby-identifier">stack</span>.<span class="ruby-identifier">pop</span>
32
- <span class="ruby-identifier">stack</span>.<span class="ruby-identifier">last</span>.<span class="ruby-identifier">add_node</span>(<span class="ruby-identifier">temp</span>)
33
- <span class="ruby-keyword kw">end</span>
34
- <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:text</span>, <span class="ruby-identifier">:cdata</span>
35
- <span class="ruby-identifier">stack</span>.<span class="ruby-identifier">last</span>.<span class="ruby-identifier">add_node</span>(<span class="ruby-identifier">event</span>[<span class="ruby-value">1</span>]) <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">event</span>[<span class="ruby-value">1</span>].<span class="ruby-identifier">strip</span>.<span class="ruby-identifier">length</span> <span class="ruby-operator">==</span> <span class="ruby-value">0</span>
36
- <span class="ruby-keyword kw">end</span>
37
- <span class="ruby-keyword kw">end</span>
38
- <span class="ruby-identifier">data</span> = <span class="ruby-identifier">stack</span>.<span class="ruby-identifier">pop</span>.<span class="ruby-identifier">to_hash</span>
39
-
40
- <span class="ruby-comment cmt"># Turn any {&quot;nil&quot; =&gt; &quot;true&quot;} into just nil</span>
41
- <span class="ruby-identifier">data</span>.<span class="ruby-identifier">crawl</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">h</span>,<span class="ruby-identifier">k</span>,<span class="ruby-identifier">v</span><span class="ruby-operator">|</span> <span class="ruby-identifier">h</span>[<span class="ruby-identifier">k</span>] = <span class="ruby-keyword kw">nil</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">v</span> <span class="ruby-operator">==</span> {}; <span class="ruby-identifier">v</span>} <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:report_nil</span>]
42
- <span class="ruby-identifier">data</span>.<span class="ruby-identifier">crawl</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">h</span>,<span class="ruby-identifier">k</span>,<span class="ruby-identifier">v</span><span class="ruby-operator">|</span> <span class="ruby-identifier">h</span>[<span class="ruby-identifier">k</span>] = <span class="ruby-keyword kw">nil</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">v</span> <span class="ruby-operator">==</span> {} <span class="ruby-operator">||</span> <span class="ruby-identifier">v</span> <span class="ruby-operator">==</span> {<span class="ruby-value str">'nil'</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'true'</span>}; <span class="ruby-identifier">v</span>} <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:report_nil</span>]
43
- <span class="ruby-identifier">data</span>
13
+ <pre><span class="ruby-comment cmt"># File lib/simple_mapper/support/bliss_serializer.rb, line 12</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">object_to_xml</span>(<span class="ruby-identifier">obj</span>, <span class="ruby-identifier">options</span>={})
15
+ <span class="ruby-comment cmt"># Automatically set the key_name for DataMapper objects</span>
16
+ <span class="ruby-identifier">options</span>.<span class="ruby-identifier">merge!</span>(<span class="ruby-identifier">:key_name</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">obj</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">table</span>.<span class="ruby-identifier">key</span>.<span class="ruby-identifier">name</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">obj</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-identifier">:table</span>) <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">obj</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-identifier">:persistent?</span>) <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">obj</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">persistent?</span>
17
+ <span class="ruby-comment cmt"># Should do the above also for ActiveRecord...</span>
18
+ <span class="ruby-identifier">to_xml</span>(<span class="ruby-identifier">obj</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">name</span>.<span class="ruby-identifier">underscore</span>, <span class="ruby-identifier">obj</span>.<span class="ruby-identifier">to_hash</span>(<span class="ruby-identifier">options</span>), <span class="ruby-identifier">options</span>)
44
19
  <span class="ruby-keyword kw">end</span></pre>
45
20
  </body>
46
21
  </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/bliss_serializer.rb, line 100</span>
13
+ <pre><span class="ruby-comment cmt"># File lib/simple_mapper/support/bliss_serializer.rb, line 18</span>
14
14
  <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">to_xml</span>(<span class="ruby-identifier">root</span>, <span class="ruby-identifier">attributes</span>={}, <span class="ruby-identifier">options</span>={})
15
15
  <span class="ruby-identifier">options</span> = <span class="ruby-constant">XML_OPTIONS</span>.<span class="ruby-identifier">merge</span>(<span class="ruby-identifier">options</span>)
16
16
  <span class="ruby-identifier">attributes</span> = <span class="ruby-identifier">attributes</span>.<span class="ruby-identifier">dup</span>.<span class="ruby-identifier">stringify_keys!</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/support/bliss_serializer.rb, line 110</span>
13
+ <pre><span class="ruby-comment cmt"># File lib/simple_mapper/support/bliss_serializer.rb, line 28</span>
14
14
  <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">to_string</span>; <span class="ruby-node">%Q[#@expanded_name=&quot;#{to_s().gsub(/&quot;/, '&amp;quot;')}&quot;]</span> <span class="ruby-keyword kw">end</span></pre>
15
15
  </body>
16
16
  </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>hash_from_xml (Serialize)</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/bliss_serializer.rb, line 43</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">hash_from_xml</span>(<span class="ruby-identifier">xml</span>,<span class="ruby-identifier">options</span>={})
15
+ <span class="ruby-identifier">xml</span>.<span class="ruby-identifier">format</span>=(<span class="ruby-identifier">:xml</span>).<span class="ruby-identifier">to_hash</span>
16
+ <span class="ruby-keyword kw">end</span></pre>
17
+ </body>
18
+ </html>