simplemapper 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (143) hide show
  1. data/LICENSE +16 -0
  2. data/README +0 -0
  3. data/Rakefile +78 -0
  4. data/doc/classes/Array.html +139 -0
  5. data/doc/classes/Array.src/M000001.html +34 -0
  6. data/doc/classes/Callbacks.html +161 -0
  7. data/doc/classes/Callbacks.src/M000037.html +18 -0
  8. data/doc/classes/Callbacks.src/M000038.html +18 -0
  9. data/doc/classes/Callbacks.src/M000039.html +19 -0
  10. data/doc/classes/Enumerable.html +131 -0
  11. data/doc/classes/Enumerable.src/M000040.html +21 -0
  12. data/doc/classes/Hash.html +154 -0
  13. data/doc/classes/Hash.src/M000002.html +18 -0
  14. data/doc/classes/Hash.src/M000003.html +34 -0
  15. data/doc/classes/Inflector/Inflections.html +323 -0
  16. data/doc/classes/Inflector/Inflections.src/M000031.html +18 -0
  17. data/doc/classes/Inflector/Inflections.src/M000032.html +18 -0
  18. data/doc/classes/Inflector/Inflections.src/M000033.html +18 -0
  19. data/doc/classes/Inflector/Inflections.src/M000034.html +19 -0
  20. data/doc/classes/Inflector/Inflections.src/M000035.html +18 -0
  21. data/doc/classes/Inflector/Inflections.src/M000036.html +23 -0
  22. data/doc/classes/Inflector.html +516 -0
  23. data/doc/classes/Inflector.src/M000017.html +22 -0
  24. data/doc/classes/Inflector.src/M000018.html +25 -0
  25. data/doc/classes/Inflector.src/M000019.html +25 -0
  26. data/doc/classes/Inflector.src/M000020.html +22 -0
  27. data/doc/classes/Inflector.src/M000021.html +18 -0
  28. data/doc/classes/Inflector.src/M000022.html +22 -0
  29. data/doc/classes/Inflector.src/M000023.html +18 -0
  30. data/doc/classes/Inflector.src/M000024.html +18 -0
  31. data/doc/classes/Inflector.src/M000025.html +18 -0
  32. data/doc/classes/Inflector.src/M000026.html +18 -0
  33. data/doc/classes/Inflector.src/M000027.html +19 -0
  34. data/doc/classes/Inflector.src/M000028.html +18 -0
  35. data/doc/classes/Inflector.src/M000029.html +22 -0
  36. data/doc/classes/Inflector.src/M000030.html +27 -0
  37. data/doc/classes/Merb/Request.html +139 -0
  38. data/doc/classes/Merb/Request.src/M000041.html +22 -0
  39. data/doc/classes/Merb.html +111 -0
  40. data/doc/classes/OAuth/RequestProxy/Base.html +139 -0
  41. data/doc/classes/OAuth/RequestProxy/Base.src/M000012.html +18 -0
  42. data/doc/classes/OAuth/RequestProxy.html +111 -0
  43. data/doc/classes/OAuth/Signature/Base.html +139 -0
  44. data/doc/classes/OAuth/Signature/Base.src/M000011.html +25 -0
  45. data/doc/classes/OAuth/Signature.html +111 -0
  46. data/doc/classes/OAuth.html +112 -0
  47. data/doc/classes/OAuthController.html +243 -0
  48. data/doc/classes/OAuthController.src/M000005.html +22 -0
  49. data/doc/classes/OAuthController.src/M000006.html +18 -0
  50. data/doc/classes/OAuthController.src/M000007.html +18 -0
  51. data/doc/classes/OAuthController.src/M000008.html +25 -0
  52. data/doc/classes/OAuthController.src/M000009.html +19 -0
  53. data/doc/classes/Object.html +142 -0
  54. data/doc/classes/Object.src/M000010.html +19 -0
  55. data/doc/classes/Proc.html +143 -0
  56. data/doc/classes/Proc.src/M000004.html +18 -0
  57. data/doc/classes/Serialize.html +189 -0
  58. data/doc/classes/Serialize.src/M000013.html +21 -0
  59. data/doc/classes/Serialize.src/M000014.html +39 -0
  60. data/doc/classes/Serialize.src/M000015.html +16 -0
  61. data/doc/classes/Serialize.src/M000016.html +46 -0
  62. data/doc/classes/SimpleMapper/Base.html +528 -0
  63. data/doc/classes/SimpleMapper/Base.src/M000064.html +16 -0
  64. data/doc/classes/SimpleMapper/Base.src/M000065.html +16 -0
  65. data/doc/classes/SimpleMapper/Base.src/M000066.html +22 -0
  66. data/doc/classes/SimpleMapper/Base.src/M000067.html +21 -0
  67. data/doc/classes/SimpleMapper/Base.src/M000068.html +26 -0
  68. data/doc/classes/SimpleMapper/Base.src/M000069.html +18 -0
  69. data/doc/classes/SimpleMapper/Base.src/M000070.html +18 -0
  70. data/doc/classes/SimpleMapper/Base.src/M000071.html +18 -0
  71. data/doc/classes/SimpleMapper/Base.src/M000072.html +19 -0
  72. data/doc/classes/SimpleMapper/Base.src/M000073.html +23 -0
  73. data/doc/classes/SimpleMapper/Base.src/M000074.html +18 -0
  74. data/doc/classes/SimpleMapper/Base.src/M000075.html +20 -0
  75. data/doc/classes/SimpleMapper/Base.src/M000076.html +18 -0
  76. data/doc/classes/SimpleMapper/Base.src/M000077.html +18 -0
  77. data/doc/classes/SimpleMapper/Base.src/M000078.html +19 -0
  78. data/doc/classes/SimpleMapper/Base.src/M000079.html +18 -0
  79. data/doc/classes/SimpleMapper/Base.src/M000080.html +18 -0
  80. data/doc/classes/SimpleMapper/Base.src/M000081.html +19 -0
  81. data/doc/classes/SimpleMapper/Base.src/M000082.html +20 -0
  82. data/doc/classes/SimpleMapper/Base.src/M000083.html +24 -0
  83. data/doc/classes/SimpleMapper/Base.src/M000084.html +18 -0
  84. data/doc/classes/SimpleMapper/HttpAdapter.html +280 -0
  85. data/doc/classes/SimpleMapper/HttpAdapter.src/M000056.html +18 -0
  86. data/doc/classes/SimpleMapper/HttpAdapter.src/M000057.html +18 -0
  87. data/doc/classes/SimpleMapper/HttpAdapter.src/M000058.html +19 -0
  88. data/doc/classes/SimpleMapper/HttpAdapter.src/M000060.html +18 -0
  89. data/doc/classes/SimpleMapper/HttpAdapter.src/M000061.html +18 -0
  90. data/doc/classes/SimpleMapper/HttpAdapter.src/M000062.html +18 -0
  91. data/doc/classes/SimpleMapper/HttpAdapter.src/M000063.html +18 -0
  92. data/doc/classes/SimpleMapper/HttpOAuthExtension.html +188 -0
  93. data/doc/classes/SimpleMapper/HttpOAuthExtension.src/M000048.html +49 -0
  94. data/doc/classes/SimpleMapper/HttpOAuthExtension.src/M000049.html +23 -0
  95. data/doc/classes/SimpleMapper/HttpOAuthExtension.src/M000050.html +18 -0
  96. data/doc/classes/SimpleMapper/HttpOAuthExtension.src/M000051.html +24 -0
  97. data/doc/classes/SimpleMapper/SimpleModel/ClassMethods.html +146 -0
  98. data/doc/classes/SimpleMapper/SimpleModel/ClassMethods.src/M000046.html +19 -0
  99. data/doc/classes/SimpleMapper/SimpleModel/ClassMethods.src/M000047.html +19 -0
  100. data/doc/classes/SimpleMapper/SimpleModel.html +184 -0
  101. data/doc/classes/SimpleMapper/SimpleModel.src/M000042.html +18 -0
  102. data/doc/classes/SimpleMapper/SimpleModel.src/M000043.html +18 -0
  103. data/doc/classes/SimpleMapper/SimpleModel.src/M000044.html +18 -0
  104. data/doc/classes/SimpleMapper/SimpleModel.src/M000045.html +24 -0
  105. data/doc/classes/SimpleMapper/XmlFormat/ClassMethods.html +152 -0
  106. data/doc/classes/SimpleMapper/XmlFormat/ClassMethods.src/M000055.html +30 -0
  107. data/doc/classes/SimpleMapper/XmlFormat.html +169 -0
  108. data/doc/classes/SimpleMapper/XmlFormat.src/M000052.html +18 -0
  109. data/doc/classes/SimpleMapper/XmlFormat.src/M000053.html +18 -0
  110. data/doc/classes/SimpleMapper/XmlFormat.src/M000054.html +18 -0
  111. data/doc/classes/SimpleMapper.html +146 -0
  112. data/doc/classes/String.html +120 -0
  113. data/doc/created.rid +1 -0
  114. data/doc/files/lib/simple_mapper/adapters/http_adapter_rb.html +110 -0
  115. data/doc/files/lib/simple_mapper/base_rb.html +108 -0
  116. data/doc/files/lib/simple_mapper/default_plugins/callbacks_rb.html +101 -0
  117. data/doc/files/lib/simple_mapper/default_plugins/oauth_rb.html +116 -0
  118. data/doc/files/lib/simple_mapper/default_plugins/simple_model_rb.html +101 -0
  119. data/doc/files/lib/simple_mapper/formats/xml_format_rb.html +108 -0
  120. data/doc/files/lib/simple_mapper/support/bliss_serializer_rb.html +109 -0
  121. data/doc/files/lib/simple_mapper/support/core_ext_rb.html +108 -0
  122. data/doc/files/lib/simple_mapper/support/inflections_rb.html +101 -0
  123. data/doc/files/lib/simple_mapper/support/inflector_rb.html +108 -0
  124. data/doc/files/lib/simple_mapper/support_rb.html +109 -0
  125. data/doc/files/lib/simple_mapper_rb.html +137 -0
  126. data/doc/fr_class_index.html +52 -0
  127. data/doc/fr_file_index.html +38 -0
  128. data/doc/fr_method_index.html +110 -0
  129. data/doc/index.html +24 -0
  130. data/doc/rdoc-style.css +208 -0
  131. data/lib/simple_mapper/adapters/http_adapter.rb +64 -0
  132. data/lib/simple_mapper/base.rb +138 -0
  133. data/lib/simple_mapper/default_plugins/callbacks.rb +12 -0
  134. data/lib/simple_mapper/default_plugins/oauth.rb +167 -0
  135. data/lib/simple_mapper/default_plugins/simple_model.rb +36 -0
  136. data/lib/simple_mapper/formats/xml_format.rb +48 -0
  137. data/lib/simple_mapper/support/bliss_serializer.rb +168 -0
  138. data/lib/simple_mapper/support/core_ext.rb +73 -0
  139. data/lib/simple_mapper/support/inflections.rb +112 -0
  140. data/lib/simple_mapper/support/inflector.rb +275 -0
  141. data/lib/simple_mapper/support.rb +2 -0
  142. data/lib/simple_mapper.rb +16 -0
  143. metadata +236 -0
@@ -0,0 +1,16 @@
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>debug? (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 7</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">debug?</span>; <span class="ruby-ivar">@debug</span> <span class="ruby-keyword kw">end</span></pre>
15
+ </body>
16
+ </html>
@@ -0,0 +1,16 @@
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>debug! (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 8</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">debug!</span>; <span class="ruby-ivar">@debug</span> = <span class="ruby-keyword kw">true</span> <span class="ruby-keyword kw">end</span></pre>
15
+ </body>
16
+ </html>
@@ -0,0 +1,22 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>connection_adapter= (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 10</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">connection_adapter=</span>(<span class="ruby-identifier">adapter</span>,<span class="ruby-identifier">debug</span>=<span class="ruby-keyword kw">nil</span>,<span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
15
+ <span class="ruby-comment cmt"># Should complain if the adapter doesn't exist.</span>
16
+ <span class="ruby-ivar">@connection_adapter</span> = <span class="ruby-identifier">adapter</span>
17
+ <span class="ruby-identifier">require</span> <span class="ruby-node">&quot;#{File.dirname(__FILE__)}/adapters/#{@connection_adapter}_adapter&quot;</span>
18
+ <span class="ruby-ivar">@connection_init</span> = <span class="ruby-identifier">block</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">block_given?</span>
19
+ <span class="ruby-ivar">@connection_debug</span> = <span class="ruby-identifier">debug</span>
20
+ <span class="ruby-keyword kw">end</span></pre>
21
+ </body>
22
+ </html>
@@ -0,0 +1,21 @@
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>format= (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 21</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">format=</span>(<span class="ruby-identifier">format</span>)
15
+ <span class="ruby-ivar">@format_name</span> = <span class="ruby-identifier">format</span>.<span class="ruby-identifier">to_s</span>
16
+ <span class="ruby-identifier">require</span> <span class="ruby-node">&quot;#{File.dirname(__FILE__)}/formats/#{@format_name}_format&quot;</span>
17
+ <span class="ruby-ivar">@format</span> = <span class="ruby-constant">Object</span>.<span class="ruby-identifier">module_eval</span>(<span class="ruby-node">&quot;::SimpleMapper::#{@format_name.camelize}Format&quot;</span>, <span class="ruby-keyword kw">__FILE__</span>, <span class="ruby-keyword kw">__LINE__</span>)
18
+ <span class="ruby-identifier">include</span> <span class="ruby-ivar">@format</span>
19
+ <span class="ruby-keyword kw">end</span></pre>
20
+ </body>
21
+ </html>
@@ -0,0 +1,26 @@
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>connection (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 30</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">connection</span>(<span class="ruby-identifier">refresh</span>=<span class="ruby-keyword kw">false</span>)
15
+ <span class="ruby-ivar">@connection</span> = <span class="ruby-keyword kw">begin</span>
16
+ <span class="ruby-comment cmt"># Initialize the connection with the connection adapter.</span>
17
+ <span class="ruby-identifier">adapter</span> = <span class="ruby-constant">Object</span>.<span class="ruby-identifier">module_eval</span>(<span class="ruby-node">&quot;::SimpleMapper::#{@connection_adapter.to_s.camelize}Adapter&quot;</span>, <span class="ruby-keyword kw">__FILE__</span>, <span class="ruby-keyword kw">__LINE__</span>).<span class="ruby-identifier">new</span>
18
+ <span class="ruby-ivar">@connection_init</span>.<span class="ruby-identifier">in_context</span>(<span class="ruby-identifier">adapter</span>).<span class="ruby-identifier">call</span> <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@connection_init</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Proc</span>)
19
+ <span class="ruby-identifier">adapter</span>.<span class="ruby-identifier">set_headers</span> <span class="ruby-identifier">format</span>.<span class="ruby-identifier">mime_type_headers</span>
20
+ <span class="ruby-identifier">adapter</span>.<span class="ruby-identifier">debug!</span> <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@connection_debug</span>
21
+ <span class="ruby-identifier">adapter</span>
22
+ <span class="ruby-keyword kw">end</span> <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-ivar">@connection</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">refresh</span>
23
+ <span class="ruby-ivar">@connection</span>
24
+ <span class="ruby-keyword kw">end</span></pre>
25
+ </body>
26
+ </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>get (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 43</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">get</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>)
15
+ <span class="ruby-identifier">extract_from</span>(<span class="ruby-identifier">connection</span>.<span class="ruby-identifier">get</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>))
16
+ <span class="ruby-keyword kw">end</span></pre>
17
+ </body>
18
+ </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>create (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 48</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">create</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>)
15
+ <span class="ruby-identifier">new</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>).<span class="ruby-identifier">save</span>
16
+ <span class="ruby-keyword kw">end</span></pre>
17
+ </body>
18
+ </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>persistent? (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 52</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">persistent?</span>
15
+ <span class="ruby-keyword kw">true</span>
16
+ <span class="ruby-keyword kw">end</span></pre>
17
+ </body>
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>extract_from (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 56</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">extract_from</span>(<span class="ruby-identifier">formatted_data</span>)
15
+ <span class="ruby-identifier">objs</span> = <span class="ruby-identifier">send</span>(<span class="ruby-node">&quot;from_#{format_name}&quot;</span><span class="ruby-node">&quot;from_#{format_name}&quot;</span>, <span class="ruby-identifier">formatted_data</span>)
16
+ <span class="ruby-identifier">objs</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Array</span>) <span class="ruby-operator">?</span> <span class="ruby-identifier">objs</span>.<span class="ruby-identifier">collect</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-identifier">extended</span> {<span class="ruby-ivar">@persisted</span> = <span class="ruby-keyword kw">true</span>}} <span class="ruby-operator">:</span> <span class="ruby-identifier">objs</span>.<span class="ruby-identifier">extended</span> {<span class="ruby-ivar">@persisted</span> = <span class="ruby-keyword kw">true</span>}
17
+ <span class="ruby-keyword kw">end</span></pre>
18
+ </body>
19
+ </html>
@@ -0,0 +1,23 @@
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>extract_one (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 61</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">extract_one</span>(<span class="ruby-identifier">formatted_data</span>, <span class="ruby-identifier">identifier</span>=<span class="ruby-keyword kw">nil</span>)
15
+ <span class="ruby-identifier">objs</span> = <span class="ruby-identifier">extract_from</span>(<span class="ruby-identifier">formatted_data</span>)
16
+ <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">objs</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Array</span>)
17
+ <span class="ruby-identifier">identifier</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-value">? </span><span class="ruby-identifier">objs</span>.<span class="ruby-identifier">first</span> <span class="ruby-operator">:</span> <span class="ruby-identifier">objs</span>.<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-identifier">identifier</span> <span class="ruby-operator">!=</span> <span class="ruby-identifier">identifier</span>}
18
+ <span class="ruby-keyword kw">else</span>
19
+ <span class="ruby-identifier">identifier</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-value">? </span><span class="ruby-identifier">objs</span> <span class="ruby-operator">:</span> (<span class="ruby-identifier">objs</span>.<span class="ruby-identifier">identifier</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">identifier</span> <span class="ruby-value">? </span><span class="ruby-identifier">objs</span> <span class="ruby-operator">:</span> <span class="ruby-keyword kw">nil</span>)
20
+ <span class="ruby-keyword kw">end</span>
21
+ <span class="ruby-keyword kw">end</span></pre>
22
+ </body>
23
+ </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>new (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 71</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">data</span>=<span class="ruby-keyword kw">nil</span>)
15
+ <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">data</span> = <span class="ruby-identifier">data</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">data</span>.<span class="ruby-identifier">nil?</span>
16
+ <span class="ruby-keyword kw">end</span></pre>
17
+ </body>
18
+ </html>
@@ -0,0 +1,20 @@
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>original_data= (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 76</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">original_data=</span>(<span class="ruby-identifier">data</span>)
15
+ <span class="ruby-ivar">@original_data</span> = <span class="ruby-identifier">data</span>.<span class="ruby-identifier">freeze</span>
16
+ <span class="ruby-ivar">@original_attributes</span> = <span class="ruby-identifier">data</span>.<span class="ruby-identifier">keys</span>
17
+ <span class="ruby-identifier">instantiate</span>(<span class="ruby-ivar">@original_data</span>)
18
+ <span class="ruby-keyword kw">end</span></pre>
19
+ </body>
20
+ </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>data= (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 83</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">data=</span>(<span class="ruby-identifier">data</span>)
15
+ <span class="ruby-identifier">instantiate</span>(<span class="ruby-identifier">data</span>)
16
+ <span class="ruby-keyword kw">end</span></pre>
17
+ </body>
18
+ </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>data (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 86</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">data</span>
15
+ <span class="ruby-identifier">to_hash</span>
16
+ <span class="ruby-keyword kw">end</span></pre>
17
+ </body>
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>instantiate (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 94</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">instantiate</span>(<span class="ruby-identifier">data</span>)
15
+ <span class="ruby-identifier">raise</span> <span class="ruby-constant">TypeError</span>, <span class="ruby-value str">&quot;data must be a hash&quot;</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">data</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Hash</span>)
16
+ <span class="ruby-identifier">data</span>.<span class="ruby-identifier">each</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">k</span>,<span class="ruby-identifier">v</span><span class="ruby-operator">|</span> <span class="ruby-identifier">instance_variable_set</span>(<span class="ruby-node">&quot;@#{k}&quot;</span><span class="ruby-node">&quot;@#{k}&quot;</span>, <span class="ruby-identifier">v</span>)}
17
+ <span class="ruby-keyword kw">end</span></pre>
18
+ </body>
19
+ </html>
@@ -0,0 +1,18 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>formatted_data (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 101</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">formatted_data</span>
15
+ <span class="ruby-identifier">send</span>(<span class="ruby-node">&quot;to_#{self.class.format_name}&quot;</span><span class="ruby-node">&quot;to_#{self.class.format_name}&quot;</span>)
16
+ <span class="ruby-keyword kw">end</span></pre>
17
+ </body>
18
+ </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>save (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 106</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">save</span>
15
+ <span class="ruby-identifier">persisted?</span> <span class="ruby-value">? </span><span class="ruby-identifier">put</span> <span class="ruby-operator">:</span> <span class="ruby-identifier">post</span>
16
+ <span class="ruby-keyword kw">end</span></pre>
17
+ </body>
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>put (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 111</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">put</span>
15
+ <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">data</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">extract_one</span>(<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">connection</span>.<span class="ruby-identifier">put</span>(<span class="ruby-identifier">identifier</span>, <span class="ruby-identifier">formatted_data</span>), <span class="ruby-identifier">identifier</span>).<span class="ruby-identifier">to_hash</span>
16
+ <span class="ruby-keyword kw">self</span>
17
+ <span class="ruby-keyword kw">end</span></pre>
18
+ </body>
19
+ </html>
@@ -0,0 +1,20 @@
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>post (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 117</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">post</span>
15
+ <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">data</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">extract_one</span>(<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">connection</span>.<span class="ruby-identifier">post</span>(<span class="ruby-identifier">formatted_data</span>)).<span class="ruby-identifier">to_hash</span>
16
+ <span class="ruby-ivar">@persisted</span> = <span class="ruby-keyword kw">true</span>
17
+ <span class="ruby-keyword kw">self</span>
18
+ <span class="ruby-keyword kw">end</span></pre>
19
+ </body>
20
+ </html>
@@ -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 124</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-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 134</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>
16
+ <span class="ruby-keyword kw">end</span></pre>
17
+ </body>
18
+ </html>