shipping 1.1.0 → 1.2.0

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.
@@ -1,26 +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 (Shipping::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/shipping/base.rb, line 22</span>
14
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">options</span> = {})
15
- <span class="ruby-identifier">prefs</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">expand_path</span>(<span class="ruby-identifier">options</span>[<span class="ruby-identifier">:prefs</span>] <span class="ruby-operator">||</span> <span class="ruby-value str">&quot;~/.shipping.yml&quot;</span>)
16
- <span class="ruby-constant">YAML</span>.<span class="ruby-identifier">load</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">open</span>(<span class="ruby-identifier">prefs</span>)).<span class="ruby-identifier">each</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">pref</span>, <span class="ruby-identifier">value</span><span class="ruby-operator">|</span> <span class="ruby-identifier">eval</span>(<span class="ruby-node">&quot;@#{pref} = #{value.inspect}&quot;</span>)} <span class="ruby-keyword kw">if</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">exists?</span>(<span class="ruby-identifier">prefs</span>)
17
-
18
- <span class="ruby-ivar">@required</span> = <span class="ruby-constant">Array</span>.<span class="ruby-identifier">new</span>
19
-
20
- <span class="ruby-comment cmt"># include all provided data</span>
21
- <span class="ruby-identifier">options</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">method</span>, <span class="ruby-identifier">value</span><span class="ruby-operator">|</span>
22
- <span class="ruby-identifier">instance_variable_set</span>(<span class="ruby-node">&quot;@#{method}&quot;</span>, <span class="ruby-identifier">value</span>)
23
- <span class="ruby-keyword kw">end</span>
24
- <span class="ruby-keyword kw">end</span></pre>
25
- </body>
26
- </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>fedex (Shipping::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/shipping/base.rb, line 35</span>
14
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">fedex</span>
15
- <span class="ruby-constant">Shipping</span><span class="ruby-operator">::</span><span class="ruby-constant">FedEx</span>.<span class="ruby-identifier">new</span> <span class="ruby-identifier">prepare_vars</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>ups (Shipping::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/shipping/base.rb, line 40</span>
14
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">ups</span>
15
- <span class="ruby-constant">Shipping</span><span class="ruby-operator">::</span><span class="ruby-constant">UPS</span>.<span class="ruby-identifier">new</span> <span class="ruby-identifier">prepare_vars</span>
16
- <span class="ruby-keyword kw">end</span></pre>
17
- </body>
18
- </html>
@@ -1,266 +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: Shipping::FedEx</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">Shipping::FedEx</td>
54
- </tr>
55
- <tr class="top-aligned-row">
56
- <td><strong>In:</strong></td>
57
- <td>
58
- <a href="../../files/lib/shipping/fedex_rb.html">
59
- lib/shipping/fedex.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="Base.html">
69
- Base
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
-
84
-
85
- </div>
86
-
87
- <div id="method-list">
88
- <h3 class="section-bar">Methods</h3>
89
-
90
- <div class="name-list">
91
- <a href="#M000004">base_price</a>&nbsp;&nbsp;
92
- <a href="#M000005">express_service_availability</a>&nbsp;&nbsp;
93
- <a href="#M000007">label</a>&nbsp;&nbsp;
94
- <a href="#M000003">price</a>&nbsp;&nbsp;
95
- <a href="#M000006">register</a>&nbsp;&nbsp;
96
- </div>
97
- </div>
98
-
99
- </div>
100
-
101
-
102
- <!-- if includes -->
103
-
104
- <div id="section">
105
-
106
-
107
- <div id="constants-list">
108
- <h3 class="section-bar">Constants</h3>
109
-
110
- <div class="name-list">
111
- <table summary="Constants">
112
- <tr class="top-aligned-row context-row">
113
- <td class="context-item-name">ServiceTypes</td>
114
- <td>=</td>
115
- <td class="context-item-value">{ &quot;priority&quot; =&gt; &quot;PRIORITYOVERNIGHT&quot;, &quot;2day&quot; =&gt; &quot;FEDEX2DAY&quot;, &quot;standard_overnight&quot; =&gt; &quot;STANDARDOVERNIGHT&quot;, &quot;first_overnight&quot; =&gt; &quot;FIRSTOVERNIGHT&quot;, &quot;express_saver&quot; =&gt; &quot;FEDEXEXPRESSSAVER&quot;, &quot;1day_freight&quot; =&gt; &quot;FEDEX1DAYFREIGHT&quot;, &quot;2day_freight&quot; =&gt; &quot;FEDEX2DAYFREIGHT&quot;, &quot;3day_freight&quot; =&gt; &quot;FEDEX3DAYFREIGHT&quot;, &quot;international_priority&quot; =&gt; &quot;INTERNATIONALPRIORITY&quot;, &quot;international_economy&quot; =&gt; &quot;INTERNATIONALECONOMY&quot;, &quot;international_first&quot; =&gt; &quot;INTERNATIONALFIRST&quot;, &quot;international_priority_freight&quot; =&gt; &quot;INTERNATIONALPRIORITYFREIGHT&quot;, &quot;international_economy_freight&quot; =&gt; &quot;INTERNATIONALECONOMYFREIGHT&quot;, &quot;home_delivery&quot; =&gt; &quot;GROUNDHOMEDELIVERY&quot;, &quot;ground_service&quot; =&gt; &quot;FEDEXGROUND&quot;, &quot;international_ground_service&quot; =&gt; &quot;INTERNATIONALGROUND&quot;</td>
116
- <td width="3em">&nbsp;</td>
117
- <td class="context-item-desc">
118
- The following type hashes are to allow cross-api data retrieval
119
-
120
- </td>
121
- </tr>
122
- <tr class="top-aligned-row context-row">
123
- <td class="context-item-name">PackageTypes</td>
124
- <td>=</td>
125
- <td class="context-item-value">{ &quot;fedex_envelope&quot; =&gt; &quot;FEDEXENVELOPE&quot;, &quot;fedex_pak&quot; =&gt; &quot;FEDEXPAK&quot;, &quot;fedex_box&quot; =&gt; &quot;FEDEXBOX&quot;, &quot;fedex_tube&quot; =&gt; &quot;FEDEXTUBE&quot;, &quot;fedex_10_kg_box&quot; =&gt; &quot;FEDEX10KGBOX&quot;, &quot;fedex_25_kg_box&quot; =&gt; &quot;FEDEX25KGBOX&quot;, &quot;your_packaging&quot; =&gt; &quot;YOURPACKAGING&quot;</td>
126
- </tr>
127
- <tr class="top-aligned-row context-row">
128
- <td class="context-item-name">DropoffTypes</td>
129
- <td>=</td>
130
- <td class="context-item-value">{ 'regular_pickup' =&gt; 'REGULARPICKUP', 'request_courier' =&gt; 'REQUESTCOURIER', 'dropbox' =&gt; 'DROPBOX', 'business_service_center' =&gt; 'BUSINESSSERVICECENTER', 'station' =&gt; 'STATION'</td>
131
- </tr>
132
- <tr class="top-aligned-row context-row">
133
- <td class="context-item-name">PaymentTypes</td>
134
- <td>=</td>
135
- <td class="context-item-value">{ 'sender' =&gt; 'SENDER', 'recipient' =&gt; 'RECIPIENT', 'third_party' =&gt; 'THIRDPARTY', 'collect' =&gt; 'COLLECT'</td>
136
- </tr>
137
- <tr class="top-aligned-row context-row">
138
- <td class="context-item-name">TransactionTypes</td>
139
- <td>=</td>
140
- <td class="context-item-value">{ 'rate_ground' =&gt; ['022','FDXG'], 'rate_express' =&gt; ['022','FDXE'], 'rate_services' =&gt; ['025',''], 'ship_ground' =&gt; ['021','FDXG'], 'ship_express' =&gt; ['021','FDXE'], 'cancel_express' =&gt; ['023','FDXE'], 'cancel_ground' =&gt; ['023','FDXG'], 'close_ground' =&gt; ['007','FDXG'], 'service_available' =&gt; ['019','FDXE'], 'fedex_locater' =&gt; ['410',''], 'subscribe' =&gt; ['211',''], 'sig_proof_delivery' =&gt; ['402',''], 'track' =&gt; ['405',''], 'ref_track' =&gt; ['403','']</td>
141
- </tr>
142
- </table>
143
- </div>
144
- </div>
145
-
146
-
147
-
148
-
149
-
150
-
151
- <!-- if method_list -->
152
- <div id="methods">
153
- <h3 class="section-bar">Public Instance methods</h3>
154
-
155
- <div id="method-M000004" class="method-detail">
156
- <a name="M000004"></a>
157
-
158
- <div class="method-heading">
159
- <a href="FedEx.src/M000004.html" target="Code" class="method-signature"
160
- onclick="popupCode('FedEx.src/M000004.html');return false;">
161
- <span class="method-name">base_price</span><span class="method-args">()</span>
162
- </a>
163
- </div>
164
-
165
- <div class="method-description">
166
- <p>
167
- Gets the base price of the shipping (with discounts taken into
168
- consideration)
169
- </p>
170
- </div>
171
- </div>
172
-
173
- <div id="method-M000005" class="method-detail">
174
- <a name="M000005"></a>
175
-
176
- <div class="method-heading">
177
- <a href="FedEx.src/M000005.html" target="Code" class="method-signature"
178
- onclick="popupCode('FedEx.src/M000005.html');return false;">
179
- <span class="method-name">express_service_availability</span><span class="method-args">()</span>
180
- </a>
181
- </div>
182
-
183
- <div class="method-description">
184
- <p>
185
- still not sure what the best way to handle this transaction&#8217;s return
186
- data would be. Possibly a hash of the form {service =&gt;
187
- delivery_estimate}?
188
- </p>
189
- </div>
190
- </div>
191
-
192
- <div id="method-M000007" class="method-detail">
193
- <a name="M000007"></a>
194
-
195
- <div class="method-heading">
196
- <a href="FedEx.src/M000007.html" target="Code" class="method-signature"
197
- onclick="popupCode('FedEx.src/M000007.html');return false;">
198
- <span class="method-name">label</span><span class="method-args">()</span>
199
- </a>
200
- </div>
201
-
202
- <div class="method-description">
203
- <p>
204
- require &#8216;fileutils&#8217; fedex = Shipping::FedEx.new :name =&gt;
205
- &#8216;John Doe&#8217;, &#8230; , :sender_zip =&gt; 97202 label =
206
- fedex.label
207
- </p>
208
- <pre>
209
- puts label.url
210
- </pre>
211
- <p>
212
- puts label.tracking_number
213
- </p>
214
- <pre>
215
- In the future you will be able to do:
216
- </pre>
217
- <p>
218
- FileUtils.cp label.image.path, &#8217;/path/to/my/images/directory/&#8217;
219
- </p>
220
- </div>
221
- </div>
222
-
223
- <div id="method-M000003" class="method-detail">
224
- <a name="M000003"></a>
225
-
226
- <div class="method-heading">
227
- <a href="FedEx.src/M000003.html" target="Code" class="method-signature"
228
- onclick="popupCode('FedEx.src/M000003.html');return false;">
229
- <span class="method-name">price</span><span class="method-args">()</span>
230
- </a>
231
- </div>
232
-
233
- <div class="method-description">
234
- <p>
235
- Gets the total price of the shipping
236
- </p>
237
- </div>
238
- </div>
239
-
240
- <div id="method-M000006" class="method-detail">
241
- <a name="M000006"></a>
242
-
243
- <div class="method-heading">
244
- <a href="FedEx.src/M000006.html" target="Code" class="method-signature"
245
- onclick="popupCode('FedEx.src/M000006.html');return false;">
246
- <span class="method-name">register</span><span class="method-args">()</span>
247
- </a>
248
- </div>
249
-
250
- <div class="method-description">
251
- </div>
252
- </div>
253
-
254
-
255
- </div>
256
-
257
-
258
- </div>
259
-
260
-
261
- <div id="validator-badges">
262
- <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
263
- </div>
264
-
265
- </body>
266
- </html>
@@ -1,21 +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>price (Shipping::FedEx)</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/shipping/fedex.rb, line 11</span>
14
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">price</span>
15
- <span class="ruby-identifier">get_price</span>
16
- <span class="ruby-identifier">p</span> = <span class="ruby-constant">REXML</span><span class="ruby-operator">::</span><span class="ruby-constant">XPath</span>.<span class="ruby-identifier">first</span>(<span class="ruby-ivar">@response</span>, <span class="ruby-value str">&quot;//FDXRateReply/EstimatedCharges/DiscountedCharges/NetCharge&quot;</span>).<span class="ruby-identifier">text</span>.<span class="ruby-identifier">to_f</span> <span class="ruby-keyword kw">rescue</span> <span class="ruby-keyword kw">nil</span>
17
- <span class="ruby-identifier">raise</span> <span class="ruby-constant">ShippingError</span>, <span class="ruby-identifier">get_error</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">p</span>.<span class="ruby-identifier">nil?</span>
18
- <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">p</span>
19
- <span class="ruby-keyword kw">end</span></pre>
20
- </body>
21
- </html>
@@ -1,21 +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>base_price (Shipping::FedEx)</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/shipping/fedex.rb, line 19</span>
14
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">base_price</span>
15
- <span class="ruby-identifier">get_price</span>
16
- <span class="ruby-identifier">p</span> = <span class="ruby-constant">REXML</span><span class="ruby-operator">::</span><span class="ruby-constant">XPath</span>.<span class="ruby-identifier">first</span>(<span class="ruby-ivar">@response</span>, <span class="ruby-value str">&quot;//FDXRateReply/EstimatedCharges/DiscountedCharges/BaseCharge&quot;</span>).<span class="ruby-identifier">text</span>.<span class="ruby-identifier">to_f</span> <span class="ruby-keyword kw">rescue</span> <span class="ruby-keyword kw">nil</span>
17
- <span class="ruby-identifier">raise</span> <span class="ruby-constant">ShippingError</span>, <span class="ruby-identifier">get_error</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">p</span>.<span class="ruby-identifier">nil?</span>
18
- <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">p</span>
19
- <span class="ruby-keyword kw">end</span></pre>
20
- </body>
21
- </html>
@@ -1,39 +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>express_service_availability (Shipping::FedEx)</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/shipping/fedex.rb, line 27</span>
14
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">express_service_availability</span>
15
-
16
- <span class="ruby-ivar">@data</span> = <span class="ruby-constant">String</span>.<span class="ruby-identifier">new</span>
17
- <span class="ruby-identifier">b</span> = <span class="ruby-constant">Builder</span><span class="ruby-operator">::</span><span class="ruby-constant">XmlMarkup</span>.<span class="ruby-identifier">new</span> <span class="ruby-identifier">:target</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@data</span>
18
- <span class="ruby-identifier">b</span>.<span class="ruby-identifier">instruct!</span>
19
- <span class="ruby-identifier">b</span>.<span class="ruby-constant">FDXServiceAvailabilityRequest</span>(<span class="ruby-value str">'xmlns:api'</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'http://www.fedex.com/fsmapi'</span>, <span class="ruby-value str">'xmlns:xsi'</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'http://www.w3.org/2001/XMLSchema-instance'</span>, <span class="ruby-value str">'xsi:noNamespaceSchemaLocation'</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'FDXServiceAvailabilityRequest.xsd'</span>) { <span class="ruby-operator">|</span><span class="ruby-identifier">b</span><span class="ruby-operator">|</span>
20
- <span class="ruby-identifier">b</span>.<span class="ruby-constant">RequestHeader</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">b</span><span class="ruby-operator">|</span>
21
- <span class="ruby-identifier">b</span>.<span class="ruby-constant">AccountNumber</span> <span class="ruby-ivar">@fedex_account</span>
22
- <span class="ruby-identifier">b</span>.<span class="ruby-constant">MeterNumber</span> <span class="ruby-ivar">@fedex_meter</span>
23
- }
24
- <span class="ruby-identifier">b</span>.<span class="ruby-constant">OriginAddress</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">b</span><span class="ruby-operator">|</span>
25
- <span class="ruby-identifier">b</span>.<span class="ruby-constant">PostalCode</span> <span class="ruby-ivar">@sender_zip</span>
26
- <span class="ruby-identifier">b</span>.<span class="ruby-constant">CountryCode</span> <span class="ruby-ivar">@sender_country_code</span> <span class="ruby-operator">||</span> <span class="ruby-value str">&quot;US&quot;</span>
27
- }
28
- <span class="ruby-identifier">b</span>.<span class="ruby-constant">DestinationAddress</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">b</span><span class="ruby-operator">|</span>
29
- <span class="ruby-identifier">b</span>.<span class="ruby-constant">PostalCode</span> <span class="ruby-ivar">@zip</span>
30
- <span class="ruby-identifier">b</span>.<span class="ruby-constant">CountryCode</span> <span class="ruby-ivar">@country</span> <span class="ruby-operator">||</span> <span class="ruby-value str">&quot;US&quot;</span>
31
- }
32
- <span class="ruby-identifier">b</span>.<span class="ruby-constant">ShipDate</span> <span class="ruby-ivar">@ship_date</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@ship_date</span>.<span class="ruby-identifier">nil?</span>
33
- <span class="ruby-identifier">b</span>.<span class="ruby-constant">PackageCount</span> <span class="ruby-ivar">@package_total</span> <span class="ruby-operator">||</span> <span class="ruby-value str">'1'</span>
34
- }
35
-
36
- <span class="ruby-identifier">get_response</span> <span class="ruby-ivar">@fedex_url</span>
37
- <span class="ruby-keyword kw">end</span></pre>
38
- </body>
39
- </html>
@@ -1,50 +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>register (Shipping::FedEx)</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/shipping/fedex.rb, line 52</span>
14
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">register</span>
15
- <span class="ruby-ivar">@required</span> = [<span class="ruby-identifier">:name</span>, <span class="ruby-identifier">:company</span>, <span class="ruby-identifier">:phone</span>, <span class="ruby-identifier">:email</span>, <span class="ruby-identifier">:address</span>, <span class="ruby-identifier">:city</span>, <span class="ruby-identifier">:state</span>, <span class="ruby-identifier">:zip</span>]
16
- <span class="ruby-ivar">@required</span> <span class="ruby-operator">+=</span> [<span class="ruby-identifier">:fedex_account</span>, <span class="ruby-identifier">:fedex_url</span>]
17
-
18
- <span class="ruby-identifier">state</span> = <span class="ruby-constant">STATES</span>.<span class="ruby-identifier">has_value?</span>(<span class="ruby-ivar">@state</span>.<span class="ruby-identifier">downcase</span>) <span class="ruby-operator">?</span> <span class="ruby-constant">STATES</span>.<span class="ruby-identifier">index</span>(<span class="ruby-ivar">@state</span>.<span class="ruby-identifier">downcase</span>).<span class="ruby-identifier">upcase</span> <span class="ruby-operator">:</span> <span class="ruby-ivar">@state</span>.<span class="ruby-identifier">upcase</span>
19
-
20
- <span class="ruby-ivar">@data</span> = <span class="ruby-constant">String</span>.<span class="ruby-identifier">new</span>
21
- <span class="ruby-identifier">b</span> = <span class="ruby-constant">Builder</span><span class="ruby-operator">::</span><span class="ruby-constant">XmlMarkup</span>.<span class="ruby-identifier">new</span> <span class="ruby-identifier">:target</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@data</span>
22
- <span class="ruby-identifier">b</span>.<span class="ruby-identifier">instruct!</span>
23
- <span class="ruby-identifier">b</span>.<span class="ruby-constant">FDXSubscriptionRequest</span>(<span class="ruby-value str">'xmlns:api'</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'http://www.fedex.com/fsmapi'</span>, <span class="ruby-value str">'xmlns:xsi'</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'http://www.w3.org/2001/XMLSchema-instance'</span>, <span class="ruby-value str">'xsi:noNamespaceSchemaLocation'</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'FDXSubscriptionRequest.xsd'</span>) { <span class="ruby-operator">|</span><span class="ruby-identifier">b</span><span class="ruby-operator">|</span>
24
- <span class="ruby-identifier">b</span>.<span class="ruby-constant">RequestHeader</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">b</span><span class="ruby-operator">|</span>
25
- <span class="ruby-identifier">b</span>.<span class="ruby-constant">CustomerTransactionIdentifier</span> <span class="ruby-ivar">@transaction_identifier</span> <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@transaction_identifier</span> <span class="ruby-comment cmt"># optional</span>
26
- <span class="ruby-identifier">b</span>.<span class="ruby-constant">AccountNumber</span> <span class="ruby-ivar">@fedex_account</span>
27
- }
28
- <span class="ruby-identifier">b</span>.<span class="ruby-constant">Contact</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">b</span><span class="ruby-operator">|</span>
29
- <span class="ruby-identifier">b</span>.<span class="ruby-constant">PersonName</span> <span class="ruby-ivar">@name</span>
30
- <span class="ruby-identifier">b</span>.<span class="ruby-constant">CompanyName</span> <span class="ruby-ivar">@company</span>
31
- <span class="ruby-identifier">b</span>.<span class="ruby-constant">Department</span> <span class="ruby-ivar">@department</span> <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@department</span>
32
- <span class="ruby-identifier">b</span>.<span class="ruby-constant">PhoneNumber</span> <span class="ruby-ivar">@phone</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-regexp re">/[^\d]/</span>,<span class="ruby-value str">&quot;&quot;</span>)
33
- <span class="ruby-identifier">b</span>.<span class="ruby-identifier">tag!</span> <span class="ruby-value str">&quot;E-MailAddress&quot;</span><span class="ruby-value str">&quot;E-MailAddress&quot;</span>, <span class="ruby-ivar">@email</span>
34
- }
35
- <span class="ruby-identifier">b</span>.<span class="ruby-constant">Address</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">b</span><span class="ruby-operator">|</span>
36
- <span class="ruby-identifier">b</span>.<span class="ruby-constant">Line1</span> <span class="ruby-ivar">@address</span>
37
- <span class="ruby-identifier">b</span>.<span class="ruby-constant">Line2</span> <span class="ruby-ivar">@address2</span> <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@address2</span>
38
- <span class="ruby-identifier">b</span>.<span class="ruby-constant">City</span> <span class="ruby-ivar">@city</span>
39
- <span class="ruby-identifier">b</span>.<span class="ruby-constant">StateOrProvinceCode</span> <span class="ruby-identifier">state</span>
40
- <span class="ruby-identifier">b</span>.<span class="ruby-constant">PostalCode</span> <span class="ruby-ivar">@zip</span>
41
- <span class="ruby-identifier">b</span>.<span class="ruby-constant">CountryCode</span> <span class="ruby-ivar">@country</span> <span class="ruby-operator">||</span> <span class="ruby-value str">'US'</span>
42
- }
43
- }
44
-
45
- <span class="ruby-identifier">get_response</span> <span class="ruby-ivar">@fedex_url</span>
46
-
47
- <span class="ruby-keyword kw">return</span> <span class="ruby-constant">REXML</span><span class="ruby-operator">::</span><span class="ruby-constant">XPath</span>.<span class="ruby-identifier">first</span>(<span class="ruby-ivar">@response</span>, <span class="ruby-value str">&quot;//FDXSubscriptionReply/MeterNumber&quot;</span>).<span class="ruby-identifier">text</span>
48
- <span class="ruby-keyword kw">end</span></pre>
49
- </body>
50
- </html>