quickbooks 0.4.0 → 0.9.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data.tar.gz.sig +0 -0
- data/History.txt +23 -0
- data/License.txt +54 -0
- data/Manifest.txt +73 -0
- data/README.txt +79 -0
- data/Rakefile +17 -78
- data/lib/quickbooks.rb +153 -7
- data/lib/quickbooks/adaptability.rb +67 -0
- data/lib/quickbooks/adapters/http_adapter.rb +94 -0
- data/lib/quickbooks/adapters/https_adapter.rb +57 -0
- data/lib/quickbooks/adapters/ole_adapter.rb +141 -110
- data/lib/quickbooks/adapters/spew_adapter.rb +39 -0
- data/lib/quickbooks/adapters/tcp_adapter.rb +71 -0
- data/lib/quickbooks/adapters/test_adapter.rb +62 -0
- data/lib/quickbooks/element.rb +385 -0
- data/lib/quickbooks/element_collection.rb +105 -0
- data/lib/quickbooks/extlib.rb +8 -0
- data/lib/quickbooks/extlib/assertions.rb +8 -0
- data/lib/quickbooks/extlib/class.rb +98 -0
- data/lib/quickbooks/extlib/days_and_times.rb +10 -0
- data/lib/quickbooks/extlib/days_and_times/duration.rb +362 -0
- data/lib/quickbooks/extlib/days_and_times/numeric.rb +48 -0
- data/lib/quickbooks/extlib/days_and_times/object.rb +19 -0
- data/lib/quickbooks/extlib/days_and_times/time.rb +137 -0
- data/lib/quickbooks/extlib/hash.rb +327 -0
- data/lib/quickbooks/extlib/hook.rb +366 -0
- data/lib/quickbooks/extlib/inflection.rb +436 -0
- data/lib/quickbooks/extlib/logger.rb +202 -0
- data/lib/quickbooks/extlib/object.rb +162 -0
- data/lib/quickbooks/extlib/pathname.rb +15 -0
- data/lib/quickbooks/extlib/rubygems.rb +38 -0
- data/lib/quickbooks/extlib/string.rb +32 -0
- data/lib/quickbooks/extlib/time.rb +41 -0
- data/lib/quickbooks/model.rb +503 -121
- data/lib/quickbooks/option.rb +95 -0
- data/lib/quickbooks/property.rb +69 -0
- data/lib/quickbooks/ruby_ext.rb +251 -0
- data/lib/quickbooks/type.rb +75 -0
- data/lib/quickbooks/types.rb +58 -0
- data/lib/quickbooks/version.rb +10 -0
- data/lib/quickbooks/xsd.rb +243 -0
- data/lib/quickbooks/xsd/attribute.rb +57 -0
- data/lib/quickbooks/xsd/choice.rb +94 -0
- data/lib/quickbooks/xsd/complex_type.rb +77 -0
- data/lib/quickbooks/xsd/element.rb +214 -0
- data/lib/quickbooks/xsd/group.rb +94 -0
- data/lib/quickbooks/xsd/restriction.rb +51 -0
- data/lib/quickbooks/xsd/sequence.rb +85 -0
- data/lib/quickbooks/xsd/simple_type.rb +87 -0
- data/lib/quickbooks/xsd/union.rb +70 -0
- data/lib/quickbooks/xsd/validation.rb +89 -0
- data/lib/quickbooks/xsd/xml_parse.rb +80 -0
- data/quickbooks.gemspec +36 -0
- data/source/qbxml21_demo.xsd +2223 -0
- data/source/qbxmlops_demo.xsd +483 -0
- data/source/qbxmltypes.xsd +160 -0
- data/spec/association_spec.rb +5 -0
- data/spec/element_collection_spec.rb +8 -0
- data/spec/find_spec.rb +30 -0
- data/spec/lib/quickbooks/element_spec.rb +83 -0
- data/spec/lib/quickbooks/elements/sales_order_add_spec.rb +14 -0
- data/spec/lib/quickbooks/elements/vendor_add_spec.rb +78 -0
- data/spec/lib/quickbooks/model_spec.rb +89 -0
- data/spec/lib/quickbooks/models/customer_spec.rb +52 -0
- data/spec/lib/quickbooks/models/invoice_spec.rb +12 -0
- data/spec/lib/quickbooks/models/sales_order_line_spec.rb +0 -0
- data/spec/lib/quickbooks/models/sales_order_spec.rb +145 -0
- data/spec/lib/quickbooks/xsd/choice_spec.rb +18 -0
- data/spec/pending_spec.rb +11 -0
- data/spec/quickbooks_spec.rb +38 -0
- data/spec/repeatable_spec.rb +20 -0
- data/spec/requires_spec.rb +10 -0
- data/spec/spec_helper.rb +5 -0
- data/spec/validation_spec.rb +24 -0
- metadata +133 -285
- metadata.gz.sig +0 -0
- data/LICENSE +0 -16
- data/README +0 -49
- data/doc/classes/Array.html +0 -368
- data/doc/classes/Array.src/M000026.html +0 -18
- data/doc/classes/Array.src/M000027.html +0 -21
- data/doc/classes/Array.src/M000028.html +0 -18
- data/doc/classes/Array.src/M000029.html +0 -19
- data/doc/classes/Array.src/M000030.html +0 -18
- data/doc/classes/Array.src/M000031.html +0 -23
- data/doc/classes/Array.src/M000032.html +0 -18
- data/doc/classes/Array.src/M000033.html +0 -18
- data/doc/classes/Array.src/M000034.html +0 -18
- data/doc/classes/Array.src/M000035.html +0 -19
- data/doc/classes/Array.src/M000036.html +0 -18
- data/doc/classes/Array.src/M000037.html +0 -23
- data/doc/classes/Array.src/M000038.html +0 -18
- data/doc/classes/Array.src/M000039.html +0 -21
- data/doc/classes/Array.src/M000040.html +0 -18
- data/doc/classes/Array.src/M000041.html +0 -18
- data/doc/classes/Class.html +0 -171
- data/doc/classes/Class.src/M000042.html +0 -18
- data/doc/classes/Class.src/M000043.html +0 -18
- data/doc/classes/Hash.html +0 -516
- data/doc/classes/Hash.src/M000001.html +0 -18
- data/doc/classes/Hash.src/M000002.html +0 -21
- data/doc/classes/Hash.src/M000003.html +0 -18
- data/doc/classes/Hash.src/M000004.html +0 -21
- data/doc/classes/Hash.src/M000005.html +0 -18
- data/doc/classes/Hash.src/M000006.html +0 -20
- data/doc/classes/Hash.src/M000007.html +0 -18
- data/doc/classes/Hash.src/M000008.html +0 -22
- data/doc/classes/Hash.src/M000009.html +0 -18
- data/doc/classes/Hash.src/M000010.html +0 -21
- data/doc/classes/Hash.src/M000011.html +0 -24
- data/doc/classes/Hash.src/M000012.html +0 -18
- data/doc/classes/Hash.src/M000013.html +0 -21
- data/doc/classes/Hash.src/M000014.html +0 -18
- data/doc/classes/Hash.src/M000015.html +0 -21
- data/doc/classes/Hash.src/M000016.html +0 -18
- data/doc/classes/Hash.src/M000017.html +0 -21
- data/doc/classes/Hash.src/M000018.html +0 -27
- data/doc/classes/Hash.src/M000019.html +0 -20
- data/doc/classes/Hash.src/M000020.html +0 -18
- data/doc/classes/Hash.src/M000021.html +0 -18
- data/doc/classes/Hash.src/M000022.html +0 -18
- data/doc/classes/Hash.src/M000023.html +0 -18
- data/doc/classes/Hash.src/M000024.html +0 -18
- data/doc/classes/Hash.src/M000025.html +0 -28
- data/doc/classes/Object.html +0 -278
- data/doc/classes/Object.src/M000044.html +0 -24
- data/doc/classes/Object.src/M000045.html +0 -19
- data/doc/classes/Object.src/M000046.html +0 -24
- data/doc/classes/Object.src/M000047.html +0 -18
- data/doc/classes/Object.src/M000048.html +0 -19
- data/doc/classes/Object.src/M000049.html +0 -18
- data/doc/classes/Object.src/M000050.html +0 -18
- data/doc/classes/Object.src/M000051.html +0 -18
- data/doc/classes/Qbxml.html +0 -131
- data/doc/classes/Qbxml/Request.html +0 -224
- data/doc/classes/Qbxml/Request.src/M000132.html +0 -66
- data/doc/classes/Qbxml/Request.src/M000133.html +0 -19
- data/doc/classes/Qbxml/Request.src/M000134.html +0 -83
- data/doc/classes/Qbxml/RequestSet.html +0 -199
- data/doc/classes/Qbxml/RequestSet.src/M000135.html +0 -22
- data/doc/classes/Qbxml/RequestSet.src/M000136.html +0 -26
- data/doc/classes/Qbxml/RequestSet.src/M000137.html +0 -18
- data/doc/classes/Qbxml/RequestSet.src/M000138.html +0 -22
- data/doc/classes/Qbxml/Response.html +0 -302
- data/doc/classes/Qbxml/Response.src/M000123.html +0 -24
- data/doc/classes/Qbxml/Response.src/M000124.html +0 -19
- data/doc/classes/Qbxml/Response.src/M000125.html +0 -55
- data/doc/classes/Qbxml/Response.src/M000126.html +0 -18
- data/doc/classes/Qbxml/Response.src/M000127.html +0 -18
- data/doc/classes/Qbxml/Response.src/M000128.html +0 -18
- data/doc/classes/Qbxml/Response.src/M000129.html +0 -18
- data/doc/classes/Qbxml/Response.src/M000130.html +0 -18
- data/doc/classes/Qbxml/Response.src/M000131.html +0 -63
- data/doc/classes/Qbxml/ResponseSet.html +0 -244
- data/doc/classes/Qbxml/ResponseSet.src/M000116.html +0 -22
- data/doc/classes/Qbxml/ResponseSet.src/M000117.html +0 -26
- data/doc/classes/Qbxml/ResponseSet.src/M000118.html +0 -24
- data/doc/classes/Qbxml/ResponseSet.src/M000119.html +0 -20
- data/doc/classes/Qbxml/ResponseSet.src/M000120.html +0 -27
- data/doc/classes/Qbxml/ResponseSet.src/M000121.html +0 -18
- data/doc/classes/Qbxml/ResponseSet.src/M000122.html +0 -18
- data/doc/classes/Quickbooks.html +0 -196
- data/doc/classes/Quickbooks/Address.html +0 -139
- data/doc/classes/Quickbooks/Address.src/M000115.html +0 -19
- data/doc/classes/Quickbooks/Base.html +0 -567
- data/doc/classes/Quickbooks/Base.src/M000095.html +0 -18
- data/doc/classes/Quickbooks/Base.src/M000096.html +0 -20
- data/doc/classes/Quickbooks/Base.src/M000097.html +0 -19
- data/doc/classes/Quickbooks/Base.src/M000098.html +0 -18
- data/doc/classes/Quickbooks/Base.src/M000099.html +0 -19
- data/doc/classes/Quickbooks/Base.src/M000100.html +0 -30
- data/doc/classes/Quickbooks/Base.src/M000101.html +0 -22
- data/doc/classes/Quickbooks/Base.src/M000102.html +0 -30
- data/doc/classes/Quickbooks/Base.src/M000103.html +0 -19
- data/doc/classes/Quickbooks/Base.src/M000104.html +0 -19
- data/doc/classes/Quickbooks/Base.src/M000105.html +0 -18
- data/doc/classes/Quickbooks/Base.src/M000106.html +0 -18
- data/doc/classes/Quickbooks/Base.src/M000107.html +0 -19
- data/doc/classes/Quickbooks/Base.src/M000108.html +0 -18
- data/doc/classes/Quickbooks/Base.src/M000109.html +0 -45
- data/doc/classes/Quickbooks/Base.src/M000110.html +0 -18
- data/doc/classes/Quickbooks/Base.src/M000111.html +0 -18
- data/doc/classes/Quickbooks/Base.src/M000112.html +0 -20
- data/doc/classes/Quickbooks/BillAddress.html +0 -113
- data/doc/classes/Quickbooks/CreditCardInfo.html +0 -113
- data/doc/classes/Quickbooks/Customer.html +0 -113
- data/doc/classes/Quickbooks/CustomerTypeRef.html +0 -113
- data/doc/classes/Quickbooks/Deleted.html +0 -113
- data/doc/classes/Quickbooks/ItemSalesTaxRef.html +0 -113
- data/doc/classes/Quickbooks/JobTypeRef.html +0 -113
- data/doc/classes/Quickbooks/ListDeleted.html +0 -139
- data/doc/classes/Quickbooks/ListDeleted.src/M000114.html +0 -18
- data/doc/classes/Quickbooks/ListItem.html +0 -170
- data/doc/classes/Quickbooks/ListItem.src/M000093.html +0 -20
- data/doc/classes/Quickbooks/ListItem.src/M000094.html +0 -18
- data/doc/classes/Quickbooks/Model.html +0 -462
- data/doc/classes/Quickbooks/Model.src/M000073.html +0 -24
- data/doc/classes/Quickbooks/Model.src/M000074.html +0 -19
- data/doc/classes/Quickbooks/Model.src/M000075.html +0 -18
- data/doc/classes/Quickbooks/Model.src/M000076.html +0 -18
- data/doc/classes/Quickbooks/Model.src/M000077.html +0 -18
- data/doc/classes/Quickbooks/Model.src/M000078.html +0 -22
- data/doc/classes/Quickbooks/Model.src/M000079.html +0 -32
- data/doc/classes/Quickbooks/Model.src/M000080.html +0 -32
- data/doc/classes/Quickbooks/Model.src/M000081.html +0 -18
- data/doc/classes/Quickbooks/Model.src/M000082.html +0 -18
- data/doc/classes/Quickbooks/Model.src/M000083.html +0 -22
- data/doc/classes/Quickbooks/Model.src/M000084.html +0 -23
- data/doc/classes/Quickbooks/Model.src/M000085.html +0 -18
- data/doc/classes/Quickbooks/Model.src/M000086.html +0 -21
- data/doc/classes/Quickbooks/Model.src/M000087.html +0 -26
- data/doc/classes/Quickbooks/Model.src/M000088.html +0 -26
- data/doc/classes/Quickbooks/Model.src/M000089.html +0 -26
- data/doc/classes/Quickbooks/Model.src/M000090.html +0 -21
- data/doc/classes/Quickbooks/Model.src/M000091.html +0 -23
- data/doc/classes/Quickbooks/OleAdapter.html +0 -129
- data/doc/classes/Quickbooks/OleAdapter/Connection.html +0 -343
- data/doc/classes/Quickbooks/OleAdapter/Connection.src/M000058.html +0 -18
- data/doc/classes/Quickbooks/OleAdapter/Connection.src/M000059.html +0 -19
- data/doc/classes/Quickbooks/OleAdapter/Connection.src/M000060.html +0 -24
- data/doc/classes/Quickbooks/OleAdapter/Connection.src/M000061.html +0 -18
- data/doc/classes/Quickbooks/OleAdapter/Connection.src/M000062.html +0 -18
- data/doc/classes/Quickbooks/OleAdapter/Connection.src/M000063.html +0 -21
- data/doc/classes/Quickbooks/OleAdapter/Connection.src/M000064.html +0 -24
- data/doc/classes/Quickbooks/OleAdapter/Connection.src/M000065.html +0 -20
- data/doc/classes/Quickbooks/OleAdapter/Connection.src/M000066.html +0 -24
- data/doc/classes/Quickbooks/OleAdapter/Connection.src/M000067.html +0 -24
- data/doc/classes/Quickbooks/OleAdapter/Ole.html +0 -209
- data/doc/classes/Quickbooks/OleAdapter/Ole.src/M000068.html +0 -21
- data/doc/classes/Quickbooks/OleAdapter/Ole.src/M000069.html +0 -22
- data/doc/classes/Quickbooks/OleAdapter/Ole.src/M000070.html +0 -18
- data/doc/classes/Quickbooks/ParentRef.html +0 -113
- data/doc/classes/Quickbooks/PreferredPaymentMethodRef.html +0 -113
- data/doc/classes/Quickbooks/PriceLevelRef.html +0 -113
- data/doc/classes/Quickbooks/QbxmlDebugAdapter.html +0 -111
- data/doc/classes/Quickbooks/QbxmlDebugAdapter/Connection.html +0 -139
- data/doc/classes/Quickbooks/QbxmlDebugAdapter/Connection.src/M000057.html +0 -18
- data/doc/classes/Quickbooks/Ref.html +0 -146
- data/doc/classes/Quickbooks/Ref.src/M000113.html +0 -18
- data/doc/classes/Quickbooks/SalesRepRef.html +0 -113
- data/doc/classes/Quickbooks/SalesTaxCodeRef.html +0 -113
- data/doc/classes/Quickbooks/ShipAddress.html +0 -113
- data/doc/classes/Quickbooks/TermsRef.html +0 -113
- data/doc/classes/Quickbooks/Transaction.html +0 -154
- data/doc/classes/Quickbooks/Transaction.src/M000071.html +0 -19
- data/doc/classes/Quickbooks/Transaction.src/M000072.html +0 -18
- data/doc/classes/Quickbooks/TxnDeleted.html +0 -139
- data/doc/classes/Quickbooks/TxnDeleted.src/M000092.html +0 -18
- data/doc/classes/String.html +0 -203
- data/doc/classes/String.src/M000052.html +0 -18
- data/doc/classes/String.src/M000053.html +0 -18
- data/doc/classes/String.src/M000054.html +0 -18
- data/doc/classes/String.src/M000055.html +0 -18
- data/doc/classes/String.src/M000056.html +0 -18
- data/doc/created.rid +0 -1
- data/doc/files/LICENSE.html +0 -129
- data/doc/files/README.html +0 -225
- data/doc/files/lib/qbxml/request_rb.html +0 -110
- data/doc/files/lib/qbxml/response_rb.html +0 -109
- data/doc/files/lib/qbxml/support_rb.html +0 -101
- data/doc/files/lib/qbxml_rb.html +0 -122
- data/doc/files/lib/quickbooks/adapters/ole_adapter_rb.html +0 -108
- data/doc/files/lib/quickbooks/adapters/qbxml_debug_adapter_rb.html +0 -108
- data/doc/files/lib/quickbooks/base_rb.html +0 -327
- data/doc/files/lib/quickbooks/model_rb.html +0 -108
- data/doc/files/lib/quickbooks/models/common/address_rb.html +0 -101
- data/doc/files/lib/quickbooks/models/common/all_refs_rb.html +0 -101
- data/doc/files/lib/quickbooks/models/customer/credit_card_info_rb.html +0 -101
- data/doc/files/lib/quickbooks/models/customer_rb.html +0 -110
- data/doc/files/lib/quickbooks/models/deleted_rb.html +0 -101
- data/doc/files/lib/quickbooks/models/list_item_rb.html +0 -101
- data/doc/files/lib/quickbooks/models/transaction_rb.html +0 -101
- data/doc/files/lib/quickbooks/ruby_magic_rb.html +0 -120
- data/doc/files/lib/quickbooks_rb.html +0 -125
- data/doc/fr_class_index.html +0 -64
- data/doc/fr_file_index.html +0 -45
- data/doc/fr_method_index.html +0 -164
- data/doc/index.html +0 -24
- data/doc/rdoc-style.css +0 -208
- data/lib/qbxml.rb +0 -3
- data/lib/qbxml/request.rb +0 -207
- data/lib/qbxml/response.rb +0 -197
- data/lib/qbxml/support.rb +0 -130
- data/lib/quickbooks/adapters/qbxml_debug_adapter.rb +0 -10
- data/lib/quickbooks/base.rb +0 -277
- data/lib/quickbooks/models/common/address.rb +0 -14
- data/lib/quickbooks/models/common/all_refs.rb +0 -37
- data/lib/quickbooks/models/customer.rb +0 -70
- data/lib/quickbooks/models/customer/credit_card_info.rb +0 -5
- data/lib/quickbooks/models/deleted.rb +0 -22
- data/lib/quickbooks/models/list_item.rb +0 -41
- data/lib/quickbooks/models/transaction.rb +0 -49
- data/lib/quickbooks/ruby_magic.rb +0 -213
|
@@ -1,24 +0,0 @@
|
|
|
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 (Qbxml::Response)</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/qbxml/response.rb, line 73</span>
|
|
14
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">xml_or_hash</span>)
|
|
15
|
-
<span class="ruby-keyword kw">if</span>(<span class="ruby-identifier">xml_or_hash</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Hash</span>))
|
|
16
|
-
<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">import_from_hash</span>(<span class="ruby-identifier">xml_or_hash</span>)
|
|
17
|
-
<span class="ruby-keyword kw">elsif</span>(<span class="ruby-identifier">xml_or_hash</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">String</span>))
|
|
18
|
-
<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">import_from_xml</span>(<span class="ruby-identifier">xml_or_hash</span>)
|
|
19
|
-
<span class="ruby-keyword kw">else</span>
|
|
20
|
-
<span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-value str">"Qbxml::ResponseSet must be initialized with either a Hash or an xml-formatted String."</span>
|
|
21
|
-
<span class="ruby-keyword kw">end</span>
|
|
22
|
-
<span class="ruby-keyword kw">end</span></pre>
|
|
23
|
-
</body>
|
|
24
|
-
</html>
|
|
@@ -1,19 +0,0 @@
|
|
|
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>import_from_xml (Qbxml::Response)</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/qbxml/response.rb, line 83</span>
|
|
14
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">import_from_xml</span>(<span class="ruby-identifier">xml</span>)
|
|
15
|
-
<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">import_from_hash</span>(<span class="ruby-identifier">xml</span>.<span class="ruby-identifier">formatted</span>(<span class="ruby-identifier">:xml</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>
|
|
@@ -1,55 +0,0 @@
|
|
|
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>import_from_hash (Qbxml::Response)</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/qbxml/response.rb, line 87</span>
|
|
14
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">import_from_hash</span>(<span class="ruby-identifier">hsh</span>)
|
|
15
|
-
<span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-value str">"Hash passed to Qbxml::Response.from_hash must contain only one top-level key"</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">hsh</span>.<span class="ruby-identifier">keys</span>.<span class="ruby-identifier">length</span> <span class="ruby-operator">==</span> <span class="ruby-value">1</span>
|
|
16
|
-
<span class="ruby-identifier">name</span> = <span class="ruby-identifier">hsh</span>.<span class="ruby-identifier">keys</span>.<span class="ruby-identifier">first</span>
|
|
17
|
-
<span class="ruby-comment cmt"># for development</span>
|
|
18
|
-
<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">raw_response</span> = <span class="ruby-identifier">hsh</span>
|
|
19
|
-
<span class="ruby-comment cmt"># * * * *</span>
|
|
20
|
-
<span class="ruby-identifier">hsh</span> = <span class="ruby-identifier">hsh</span>[<span class="ruby-identifier">name</span>]
|
|
21
|
-
|
|
22
|
-
<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">status</span> = <span class="ruby-identifier">hsh</span>[<span class="ruby-value str">'statusCode'</span>].<span class="ruby-identifier">to_i</span>
|
|
23
|
-
<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">severity</span> = <span class="ruby-identifier">hsh</span>[<span class="ruby-value str">'statusSeverity'</span>]
|
|
24
|
-
<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">message</span> = <span class="ruby-identifier">hsh</span>[<span class="ruby-value str">'statusMessage'</span>]
|
|
25
|
-
<span class="ruby-comment cmt"># if self.status == 0 # Status is good, proceed with eating the request.</span>
|
|
26
|
-
<span class="ruby-comment cmt"># <ListDeletedQueryRs requestID="5" statusCode="0" statusSeverity="Info" statusMessage="Status OK"></span>
|
|
27
|
-
<span class="ruby-comment cmt"># <ListDeletedRet></span>
|
|
28
|
-
<span class="ruby-comment cmt"># <ListDelType>Customer</ListDelType></span>
|
|
29
|
-
<span class="ruby-comment cmt"># <ListID>80000030-1203622308</ListID></span>
|
|
30
|
-
<span class="ruby-comment cmt"># <TimeCreated>2008-02-21T14:31:48-05:00</TimeCreated></span>
|
|
31
|
-
<span class="ruby-comment cmt"># <TimeDeleted>2008-03-18T17:31:12-05:00</TimeDeleted></span>
|
|
32
|
-
<span class="ruby-comment cmt"># <FullName>Rachel Parker</FullName></span>
|
|
33
|
-
<span class="ruby-comment cmt"># </ListDeletedRet></span>
|
|
34
|
-
<span class="ruby-comment cmt"># </ListDeletedQueryRs></span>
|
|
35
|
-
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">m</span> = <span class="ruby-identifier">name</span>.<span class="ruby-identifier">match</span>(<span class="ruby-regexp re">/^(List|Txn)Del(etedQuery)?Rs$/</span>)
|
|
36
|
-
<span class="ruby-comment cmt"># (List|Txn)DelRs, or (List|Txn)DeletedQueryRs - both return just a few attributes, like ListID / TxnID and TimeDeleted</span>
|
|
37
|
-
<span class="ruby-identifier">list_or_txn</span> = <span class="ruby-identifier">m</span>[<span class="ruby-value">1</span>]
|
|
38
|
-
<span class="ruby-identifier">long_name</span> = <span class="ruby-identifier">m</span>[<span class="ruby-value">1</span>]<span class="ruby-operator">+</span><span class="ruby-value str">'Del'</span><span class="ruby-operator">+</span><span class="ruby-identifier">m</span>[<span class="ruby-value">2</span>].<span class="ruby-identifier">to_s</span>
|
|
39
|
-
<span class="ruby-identifier">ret_key</span> = <span class="ruby-identifier">long_name</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-regexp re">/Query$/</span>,<span class="ruby-value str">''</span>)<span class="ruby-operator">+</span><span class="ruby-value str">'Ret'</span>
|
|
40
|
-
<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">ret_items</span> = <span class="ruby-identifier">hsh</span>[<span class="ruby-identifier">ret_key</span>].<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Array</span>) <span class="ruby-operator">?</span> <span class="ruby-identifier">hsh</span>[<span class="ruby-identifier">ret_key</span>] <span class="ruby-operator">:</span> [<span class="ruby-identifier">hsh</span>[<span class="ruby-identifier">ret_key</span>]].<span class="ruby-identifier">compact</span> <span class="ruby-comment cmt"># Force to be an array - it's return items!</span>
|
|
41
|
-
<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">response_type</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">ret_items</span>.<span class="ruby-identifier">empty?</span> <span class="ruby-value">? </span><span class="ruby-identifier">m</span>[<span class="ruby-value">1</span>] <span class="ruby-operator">:</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">ret_items</span>[<span class="ruby-value">0</span>][<span class="ruby-identifier">list_or_txn</span><span class="ruby-operator">+</span><span class="ruby-value str">'DelType'</span>]
|
|
42
|
-
<span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">m</span> = <span class="ruby-identifier">name</span>.<span class="ruby-identifier">match</span>(<span class="ruby-regexp re">/^((?:[A-Za-z][a-z]+)+)(Query|Mod|Add)Rs$/</span>)
|
|
43
|
-
<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">response_type</span> = <span class="ruby-identifier">m</span>[<span class="ruby-value">1</span>]
|
|
44
|
-
<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">ret_items</span> = <span class="ruby-identifier">hsh</span>[<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">response_type</span><span class="ruby-operator">+</span><span class="ruby-value str">'Ret'</span>]
|
|
45
|
-
<span class="ruby-keyword kw">else</span>
|
|
46
|
-
<span class="ruby-identifier">raise</span> <span class="ruby-node">"Could not read this response:\n#{self.raw_response.inspect}"</span>
|
|
47
|
-
<span class="ruby-keyword kw">end</span>
|
|
48
|
-
<span class="ruby-comment cmt"># else # Status is bad.</span>
|
|
49
|
-
|
|
50
|
-
<span class="ruby-comment cmt"># end</span>
|
|
51
|
-
<span class="ruby-comment cmt"># puts self.inspect</span>
|
|
52
|
-
<span class="ruby-keyword kw">self</span>
|
|
53
|
-
<span class="ruby-keyword kw">end</span></pre>
|
|
54
|
-
</body>
|
|
55
|
-
</html>
|
|
@@ -1,18 +0,0 @@
|
|
|
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>from_xml (Qbxml::Response)</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/qbxml/response.rb, line 130</span>
|
|
14
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">from_xml</span>(<span class="ruby-identifier">xml</span>)
|
|
15
|
-
<span class="ruby-identifier">new</span>.<span class="ruby-identifier">import_from_xml</span>(<span class="ruby-identifier">xml</span>)
|
|
16
|
-
<span class="ruby-keyword kw">end</span></pre>
|
|
17
|
-
</body>
|
|
18
|
-
</html>
|
|
@@ -1,18 +0,0 @@
|
|
|
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>from_hash (Qbxml::Response)</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/qbxml/response.rb, line 133</span>
|
|
14
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">from_hash</span>(<span class="ruby-identifier">hsh</span>)
|
|
15
|
-
<span class="ruby-identifier">new</span>.<span class="ruby-identifier">import_from_hash</span>(<span class="ruby-identifier">hsh</span>)
|
|
16
|
-
<span class="ruby-keyword kw">end</span></pre>
|
|
17
|
-
</body>
|
|
18
|
-
</html>
|
|
@@ -1,18 +0,0 @@
|
|
|
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>instantiatable? (Qbxml::Response)</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/qbxml/response.rb, line 138</span>
|
|
14
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">instantiatable?</span> <span class="ruby-comment cmt"># Just checks to see if it can create an object of this type, and if there is actually data to instantiate</span>
|
|
15
|
-
<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">response_type</span> <span class="ruby-value">? </span>(<span class="ruby-constant">Quickbooks</span>.<span class="ruby-identifier">const_defined?</span>(<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">response_type</span>) <span class="ruby-operator">&&</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">ret_items</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Hash</span>) <span class="ruby-operator">||</span> (<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">ret_items</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Array</span>) <span class="ruby-operator">&&</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">ret_items</span>[<span class="ruby-value">0</span>].<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Hash</span>))) <span class="ruby-operator">:</span> <span class="ruby-keyword kw">false</span>
|
|
16
|
-
<span class="ruby-keyword kw">end</span></pre>
|
|
17
|
-
</body>
|
|
18
|
-
</html>
|
|
@@ -1,18 +0,0 @@
|
|
|
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>success? (Qbxml::Response)</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/qbxml/response.rb, line 141</span>
|
|
14
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">success?</span>
|
|
15
|
-
<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">status</span> <span class="ruby-operator">==</span> <span class="ruby-value">0</span>
|
|
16
|
-
<span class="ruby-keyword kw">end</span></pre>
|
|
17
|
-
</body>
|
|
18
|
-
</html>
|
|
@@ -1,18 +0,0 @@
|
|
|
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>error? (Qbxml::Response)</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/qbxml/response.rb, line 144</span>
|
|
14
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">error?</span>
|
|
15
|
-
<span class="ruby-operator">!</span><span class="ruby-identifier">success?</span>
|
|
16
|
-
<span class="ruby-keyword kw">end</span></pre>
|
|
17
|
-
</body>
|
|
18
|
-
</html>
|
|
@@ -1,63 +0,0 @@
|
|
|
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 (Qbxml::Response)</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/qbxml/response.rb, line 148</span>
|
|
14
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">instantiate</span>(<span class="ruby-identifier">reinstantiate</span>=<span class="ruby-keyword kw">nil</span>)
|
|
15
|
-
<span class="ruby-identifier">objs</span> = []
|
|
16
|
-
(<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">ret_items</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Array</span>) <span class="ruby-operator">?</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">ret_items</span> <span class="ruby-operator">:</span> [<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">ret_items</span>]).<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">ret_item</span><span class="ruby-operator">|</span>
|
|
17
|
-
<span class="ruby-identifier">obj</span> = <span class="ruby-identifier">reinstantiate</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">reinstantiate</span>
|
|
18
|
-
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">instantiatable?</span>
|
|
19
|
-
<span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">status</span> <span class="ruby-operator">==</span> <span class="ruby-value">0</span>
|
|
20
|
-
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">obj</span>.<span class="ruby-identifier">nil?</span>
|
|
21
|
-
<span class="ruby-identifier">obj</span> = <span class="ruby-node">"Quickbooks::#{self.response_type}"</span>.<span class="ruby-identifier">constantize</span>.<span class="ruby-identifier">instantiate</span>(<span class="ruby-identifier">ret_item</span>)
|
|
22
|
-
<span class="ruby-keyword kw">else</span>
|
|
23
|
-
<span class="ruby-identifier">obj</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">instantiate</span>(<span class="ruby-identifier">obj</span>, <span class="ruby-identifier">ret_item</span>)
|
|
24
|
-
<span class="ruby-keyword kw">end</span>
|
|
25
|
-
<span class="ruby-keyword kw">else</span>
|
|
26
|
-
<span class="ruby-comment cmt"># Instantiatable, but some error status. For any error status</span>
|
|
27
|
-
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">obj</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-comment cmt"># Must be a new object. Just as well, create a new object WITHOUT any original_attributes.</span>
|
|
28
|
-
<span class="ruby-identifier">obj</span> = <span class="ruby-node">"Quickbooks::#{self.response_type}"</span>.<span class="ruby-identifier">constantize</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">ret_item</span>)
|
|
29
|
-
<span class="ruby-keyword kw">else</span> <span class="ruby-comment cmt"># An existing object. Must be an update or delete request. Update object's original_attributes.</span>
|
|
30
|
-
<span class="ruby-identifier">updated</span> = []
|
|
31
|
-
<span class="ruby-identifier">ret_item</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>
|
|
32
|
-
<span class="ruby-identifier">k</span> = <span class="ruby-identifier">k</span>.<span class="ruby-identifier">underscore</span>
|
|
33
|
-
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">obj</span>.<span class="ruby-identifier">original_values</span>[<span class="ruby-identifier">k</span>] <span class="ruby-operator">!=</span> <span class="ruby-identifier">v</span>
|
|
34
|
-
<span class="ruby-identifier">updated</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">k</span>
|
|
35
|
-
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">obj</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">instance_variable_get</span>(<span class="ruby-value str">'@object_properties'</span>).<span class="ruby-identifier">has_key?</span>(<span class="ruby-identifier">k</span>.<span class="ruby-identifier">to_sym</span>)
|
|
36
|
-
<span class="ruby-identifier">obj</span>.<span class="ruby-identifier">original_values</span>[<span class="ruby-identifier">k</span>] = <span class="ruby-identifier">obj</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">instance_variable_get</span>(<span class="ruby-value str">'@object_properties'</span>)[<span class="ruby-identifier">k</span>.<span class="ruby-identifier">to_sym</span>].<span class="ruby-identifier">new</span>(<span class="ruby-identifier">v</span>)
|
|
37
|
-
<span class="ruby-keyword kw">else</span>
|
|
38
|
-
<span class="ruby-identifier">obj</span>.<span class="ruby-identifier">original_values</span>[<span class="ruby-identifier">k</span>] = <span class="ruby-identifier">v</span>
|
|
39
|
-
<span class="ruby-keyword kw">end</span>
|
|
40
|
-
<span class="ruby-keyword kw">end</span>
|
|
41
|
-
<span class="ruby-keyword kw">end</span>
|
|
42
|
-
<span class="ruby-comment cmt"># Update object's 'read-only' attributes (as well as in the original_values):</span>
|
|
43
|
-
<span class="ruby-identifier">obj</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">read_only</span>.<span class="ruby-identifier">stringify_values</span>.<span class="ruby-identifier">camelize_values</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-operator">|</span>
|
|
44
|
-
<span class="ruby-identifier">obj</span>.<span class="ruby-identifier">send</span>(<span class="ruby-identifier">k</span>.<span class="ruby-identifier">underscore</span> <span class="ruby-operator">+</span> <span class="ruby-value str">'='</span>, <span class="ruby-identifier">ret_item</span>[<span class="ruby-identifier">k</span>]) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">ret_item</span>.<span class="ruby-identifier">has_key?</span>(<span class="ruby-identifier">k</span>) <span class="ruby-operator">&&</span> <span class="ruby-identifier">obj</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-identifier">k</span>.<span class="ruby-identifier">underscore</span> <span class="ruby-operator">+</span> <span class="ruby-value str">'='</span>)
|
|
45
|
-
<span class="ruby-keyword kw">end</span>
|
|
46
|
-
<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">message</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">message</span> <span class="ruby-operator">+</span> <span class="ruby-value str">" Other properties were out of date: ["</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">updated</span>.<span class="ruby-identifier">join</span>(<span class="ruby-value str">', '</span>) <span class="ruby-operator">+</span> <span class="ruby-value str">'].'</span>
|
|
47
|
-
<span class="ruby-keyword kw">end</span>
|
|
48
|
-
<span class="ruby-identifier">obj</span>.<span class="ruby-identifier">errors</span> <span class="ruby-operator"><<</span> {<span class="ruby-identifier">:code</span> =<span class="ruby-operator">></span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">status</span>, <span class="ruby-identifier">:message</span> =<span class="ruby-operator">></span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">message</span>, <span class="ruby-identifier">:response</span> =<span class="ruby-operator">></span> <span class="ruby-keyword kw">self</span>}
|
|
49
|
-
<span class="ruby-keyword kw">end</span>
|
|
50
|
-
<span class="ruby-keyword kw">else</span>
|
|
51
|
-
<span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">status</span> <span class="ruby-operator">==</span> <span class="ruby-value">0</span>
|
|
52
|
-
<span class="ruby-identifier">obj</span>.<span class="ruby-identifier">errors</span> <span class="ruby-operator"><<</span> {<span class="ruby-identifier">:code</span> =<span class="ruby-operator">></span> <span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">:message</span> =<span class="ruby-operator">></span> <span class="ruby-node">"Cannot instantiate object of type #{self.response_type}!"</span>, <span class="ruby-identifier">:response</span> =<span class="ruby-operator">></span> <span class="ruby-keyword kw">self</span>}
|
|
53
|
-
<span class="ruby-keyword kw">else</span>
|
|
54
|
-
<span class="ruby-identifier">obj</span>.<span class="ruby-identifier">errors</span> <span class="ruby-operator"><<</span> {<span class="ruby-identifier">:code</span> =<span class="ruby-operator">></span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">status</span>, <span class="ruby-identifier">:message</span> =<span class="ruby-operator">></span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">message</span>, <span class="ruby-identifier">:response</span> =<span class="ruby-operator">></span> <span class="ruby-keyword kw">self</span>}
|
|
55
|
-
<span class="ruby-keyword kw">end</span>
|
|
56
|
-
<span class="ruby-keyword kw">end</span>
|
|
57
|
-
<span class="ruby-identifier">obj</span>.<span class="ruby-identifier">response_log</span> <span class="ruby-operator"><<</span> <span class="ruby-keyword kw">self</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">obj</span>.<span class="ruby-identifier">nil?</span>
|
|
58
|
-
<span class="ruby-identifier">objs</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">obj</span>
|
|
59
|
-
<span class="ruby-keyword kw">end</span>
|
|
60
|
-
<span class="ruby-identifier">objs</span>.<span class="ruby-identifier">length</span> <span class="ruby-operator">></span> <span class="ruby-value">1</span> <span class="ruby-operator">?</span> <span class="ruby-identifier">objs</span> <span class="ruby-operator">:</span> <span class="ruby-identifier">objs</span>[<span class="ruby-value">0</span>] <span class="ruby-comment cmt"># Single (fallback nil) if not more than one.</span>
|
|
61
|
-
<span class="ruby-keyword kw">end</span></pre>
|
|
62
|
-
</body>
|
|
63
|
-
</html>
|
|
@@ -1,244 +0,0 @@
|
|
|
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 xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
|
7
|
-
<head>
|
|
8
|
-
<title>Class: Qbxml::ResponseSet</title>
|
|
9
|
-
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
|
10
|
-
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
|
11
|
-
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
|
12
|
-
<script type="text/javascript">
|
|
13
|
-
// <![CDATA[
|
|
14
|
-
|
|
15
|
-
function popupCode( url ) {
|
|
16
|
-
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
function toggleCode( id ) {
|
|
20
|
-
if ( document.getElementById )
|
|
21
|
-
elem = document.getElementById( id );
|
|
22
|
-
else if ( document.all )
|
|
23
|
-
elem = eval( "document.all." + id );
|
|
24
|
-
else
|
|
25
|
-
return false;
|
|
26
|
-
|
|
27
|
-
elemStyle = elem.style;
|
|
28
|
-
|
|
29
|
-
if ( elemStyle.display != "block" ) {
|
|
30
|
-
elemStyle.display = "block"
|
|
31
|
-
} else {
|
|
32
|
-
elemStyle.display = "none"
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
return true;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
// Make codeblocks hidden by default
|
|
39
|
-
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
|
40
|
-
|
|
41
|
-
// ]]>
|
|
42
|
-
</script>
|
|
43
|
-
|
|
44
|
-
</head>
|
|
45
|
-
<body>
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
<div id="classHeader">
|
|
50
|
-
<table class="header-table">
|
|
51
|
-
<tr class="top-aligned-row">
|
|
52
|
-
<td><strong>Class</strong></td>
|
|
53
|
-
<td class="class-name-in-header">Qbxml::ResponseSet</td>
|
|
54
|
-
</tr>
|
|
55
|
-
<tr class="top-aligned-row">
|
|
56
|
-
<td><strong>In:</strong></td>
|
|
57
|
-
<td>
|
|
58
|
-
<a href="../../files/lib/qbxml/response_rb.html">
|
|
59
|
-
lib/qbxml/response.rb
|
|
60
|
-
</a>
|
|
61
|
-
<br />
|
|
62
|
-
</td>
|
|
63
|
-
</tr>
|
|
64
|
-
|
|
65
|
-
<tr class="top-aligned-row">
|
|
66
|
-
<td><strong>Parent:</strong></td>
|
|
67
|
-
<td>
|
|
68
|
-
<a href="../Object.html">
|
|
69
|
-
Object
|
|
70
|
-
</a>
|
|
71
|
-
</td>
|
|
72
|
-
</tr>
|
|
73
|
-
</table>
|
|
74
|
-
</div>
|
|
75
|
-
<!-- banner header -->
|
|
76
|
-
|
|
77
|
-
<div id="bodyContent">
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
<div id="contextContent">
|
|
82
|
-
|
|
83
|
-
<div id="description">
|
|
84
|
-
<p>
|
|
85
|
-
module ResponseSetArrayExt end
|
|
86
|
-
</p>
|
|
87
|
-
|
|
88
|
-
</div>
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
</div>
|
|
92
|
-
|
|
93
|
-
<div id="method-list">
|
|
94
|
-
<h3 class="section-bar">Methods</h3>
|
|
95
|
-
|
|
96
|
-
<div class="name-list">
|
|
97
|
-
<a href="#M000117"><<</a>
|
|
98
|
-
<a href="#M000120">append_from_hash</a>
|
|
99
|
-
<a href="#M000119">append_from_xml</a>
|
|
100
|
-
<a href="#M000122">from_hash</a>
|
|
101
|
-
<a href="#M000121">from_xml</a>
|
|
102
|
-
<a href="#M000118">new</a>
|
|
103
|
-
<a href="#M000116">set</a>
|
|
104
|
-
</div>
|
|
105
|
-
</div>
|
|
106
|
-
|
|
107
|
-
</div>
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
<!-- if includes -->
|
|
111
|
-
<div id="includes">
|
|
112
|
-
<h3 class="section-bar">Included Modules</h3>
|
|
113
|
-
|
|
114
|
-
<div id="includes-list">
|
|
115
|
-
<span class="include-name">Enumerable</span>
|
|
116
|
-
</div>
|
|
117
|
-
</div>
|
|
118
|
-
|
|
119
|
-
<div id="section">
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
<!-- if method_list -->
|
|
129
|
-
<div id="methods">
|
|
130
|
-
<h3 class="section-bar">Public Class methods</h3>
|
|
131
|
-
|
|
132
|
-
<div id="method-M000122" class="method-detail">
|
|
133
|
-
<a name="M000122"></a>
|
|
134
|
-
|
|
135
|
-
<div class="method-heading">
|
|
136
|
-
<a href="ResponseSet.src/M000122.html" target="Code" class="method-signature"
|
|
137
|
-
onclick="popupCode('ResponseSet.src/M000122.html');return false;">
|
|
138
|
-
<span class="method-name">from_hash</span><span class="method-args">(hsh)</span>
|
|
139
|
-
</a>
|
|
140
|
-
</div>
|
|
141
|
-
|
|
142
|
-
<div class="method-description">
|
|
143
|
-
</div>
|
|
144
|
-
</div>
|
|
145
|
-
|
|
146
|
-
<div id="method-M000121" class="method-detail">
|
|
147
|
-
<a name="M000121"></a>
|
|
148
|
-
|
|
149
|
-
<div class="method-heading">
|
|
150
|
-
<a href="ResponseSet.src/M000121.html" target="Code" class="method-signature"
|
|
151
|
-
onclick="popupCode('ResponseSet.src/M000121.html');return false;">
|
|
152
|
-
<span class="method-name">from_xml</span><span class="method-args">(xml)</span>
|
|
153
|
-
</a>
|
|
154
|
-
</div>
|
|
155
|
-
|
|
156
|
-
<div class="method-description">
|
|
157
|
-
</div>
|
|
158
|
-
</div>
|
|
159
|
-
|
|
160
|
-
<div id="method-M000118" class="method-detail">
|
|
161
|
-
<a name="M000118"></a>
|
|
162
|
-
|
|
163
|
-
<div class="method-heading">
|
|
164
|
-
<a href="ResponseSet.src/M000118.html" target="Code" class="method-signature"
|
|
165
|
-
onclick="popupCode('ResponseSet.src/M000118.html');return false;">
|
|
166
|
-
<span class="method-name">new</span><span class="method-args">(xml_or_hash)</span>
|
|
167
|
-
</a>
|
|
168
|
-
</div>
|
|
169
|
-
|
|
170
|
-
<div class="method-description">
|
|
171
|
-
</div>
|
|
172
|
-
</div>
|
|
173
|
-
|
|
174
|
-
<h3 class="section-bar">Public Instance methods</h3>
|
|
175
|
-
|
|
176
|
-
<div id="method-M000117" class="method-detail">
|
|
177
|
-
<a name="M000117"></a>
|
|
178
|
-
|
|
179
|
-
<div class="method-heading">
|
|
180
|
-
<a href="ResponseSet.src/M000117.html" target="Code" class="method-signature"
|
|
181
|
-
onclick="popupCode('ResponseSet.src/M000117.html');return false;">
|
|
182
|
-
<span class="method-name"><<</span><span class="method-args">(qbxml_response)</span>
|
|
183
|
-
</a>
|
|
184
|
-
</div>
|
|
185
|
-
|
|
186
|
-
<div class="method-description">
|
|
187
|
-
</div>
|
|
188
|
-
</div>
|
|
189
|
-
|
|
190
|
-
<div id="method-M000120" class="method-detail">
|
|
191
|
-
<a name="M000120"></a>
|
|
192
|
-
|
|
193
|
-
<div class="method-heading">
|
|
194
|
-
<a href="ResponseSet.src/M000120.html" target="Code" class="method-signature"
|
|
195
|
-
onclick="popupCode('ResponseSet.src/M000120.html');return false;">
|
|
196
|
-
<span class="method-name">append_from_hash</span><span class="method-args">(hsh)</span>
|
|
197
|
-
</a>
|
|
198
|
-
</div>
|
|
199
|
-
|
|
200
|
-
<div class="method-description">
|
|
201
|
-
</div>
|
|
202
|
-
</div>
|
|
203
|
-
|
|
204
|
-
<div id="method-M000119" class="method-detail">
|
|
205
|
-
<a name="M000119"></a>
|
|
206
|
-
|
|
207
|
-
<div class="method-heading">
|
|
208
|
-
<a href="ResponseSet.src/M000119.html" target="Code" class="method-signature"
|
|
209
|
-
onclick="popupCode('ResponseSet.src/M000119.html');return false;">
|
|
210
|
-
<span class="method-name">append_from_xml</span><span class="method-args">(xml)</span>
|
|
211
|
-
</a>
|
|
212
|
-
</div>
|
|
213
|
-
|
|
214
|
-
<div class="method-description">
|
|
215
|
-
</div>
|
|
216
|
-
</div>
|
|
217
|
-
|
|
218
|
-
<div id="method-M000116" class="method-detail">
|
|
219
|
-
<a name="M000116"></a>
|
|
220
|
-
|
|
221
|
-
<div class="method-heading">
|
|
222
|
-
<a href="ResponseSet.src/M000116.html" target="Code" class="method-signature"
|
|
223
|
-
onclick="popupCode('ResponseSet.src/M000116.html');return false;">
|
|
224
|
-
<span class="method-name">set</span><span class="method-args">()</span>
|
|
225
|
-
</a>
|
|
226
|
-
</div>
|
|
227
|
-
|
|
228
|
-
<div class="method-description">
|
|
229
|
-
</div>
|
|
230
|
-
</div>
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
</div>
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
</div>
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
<div id="validator-badges">
|
|
240
|
-
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
|
241
|
-
</div>
|
|
242
|
-
|
|
243
|
-
</body>
|
|
244
|
-
</html>
|