trackerific 0.2.1 → 0.3.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.
- data/.yardoc/checksums +6 -0
- data/.yardoc/objects/root.dat +0 -0
- data/.yardoc/proxy_types +0 -0
- data/VERSION +1 -1
- data/doc/Trackerific.html +258 -0
- data/doc/Trackerific/Base.html +390 -0
- data/doc/Trackerific/Details.html +514 -0
- data/doc/Trackerific/Error.html +127 -0
- data/doc/Trackerific/Event.html +601 -0
- data/doc/Trackerific/FedEx.html +395 -0
- data/doc/Trackerific/UPS.html +360 -0
- data/doc/Trackerific/USPS.html +453 -0
- data/doc/_index.html +195 -0
- data/doc/class_list.html +47 -0
- data/doc/css/common.css +1 -0
- data/doc/css/full_list.css +53 -0
- data/doc/css/style.css +320 -0
- data/doc/file.README.html +213 -0
- data/doc/file_list.html +49 -0
- data/doc/frames.html +13 -0
- data/doc/index.html +213 -0
- data/doc/js/app.js +205 -0
- data/doc/js/full_list.js +150 -0
- data/doc/js/jquery.js +16 -0
- data/doc/method_list.html +206 -0
- data/doc/top-level-namespace.html +103 -0
- data/lib/fedex.rb +17 -7
- data/lib/trackerific.rb +16 -2
- data/lib/trackerific_details.rb +30 -0
- data/lib/trackerific_event.rb +38 -0
- data/lib/ups.rb +40 -14
- data/lib/usps.rb +28 -5
- data/spec/lib/fedex_spec.rb +8 -10
- data/spec/lib/trackerific_details_spec.rb +19 -0
- data/spec/lib/trackerific_event_spec.rb +20 -0
- data/spec/lib/ups_spec.rb +8 -6
- data/spec/lib/usps_spec.rb +8 -10
- data/trackerific.gemspec +32 -1
- metadata +35 -4
data/.yardoc/checksums
ADDED
@@ -0,0 +1,6 @@
|
|
1
|
+
lib/ups.rb 2b98972c48bd4032d5a6cd2017549ce394e8ea0d
|
2
|
+
lib/usps.rb b6e83100cd5225341ce5a61f0ff843440309e063
|
3
|
+
lib/fedex.rb ba42d502349530fe2518303c23d2b8babecd5f2d
|
4
|
+
lib/trackerific.rb e559eb82a7572089ee2cfd48cbe2ec662d3c4c18
|
5
|
+
lib/trackerific_event.rb 21e48404ba7b8b90114ce0d74d38248a637a0452
|
6
|
+
lib/trackerific_details.rb d3c5cc1844259f2889b4d82920b12ad57fe4d412
|
Binary file
|
data/.yardoc/proxy_types
ADDED
Binary file
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.3.0
|
@@ -0,0 +1,258 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
2
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
3
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
4
|
+
<head>
|
5
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
6
|
+
<title>
|
7
|
+
Module: Trackerific
|
8
|
+
|
9
|
+
— Documentation by YARD 0.7.1
|
10
|
+
|
11
|
+
</title>
|
12
|
+
|
13
|
+
<link rel="stylesheet" href="css/style.css" type="text/css" media="screen" charset="utf-8" />
|
14
|
+
|
15
|
+
<link rel="stylesheet" href="css/common.css" type="text/css" media="screen" charset="utf-8" />
|
16
|
+
|
17
|
+
<script type="text/javascript" charset="utf-8">
|
18
|
+
relpath = '';
|
19
|
+
if (relpath != '') relpath += '/';
|
20
|
+
</script>
|
21
|
+
|
22
|
+
<script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
|
23
|
+
|
24
|
+
<script type="text/javascript" charset="utf-8" src="js/app.js"></script>
|
25
|
+
|
26
|
+
|
27
|
+
</head>
|
28
|
+
<body>
|
29
|
+
<script type="text/javascript" charset="utf-8">
|
30
|
+
if (window.top.frames.main) document.body.className = 'frames';
|
31
|
+
</script>
|
32
|
+
|
33
|
+
<div id="header">
|
34
|
+
<div id="menu">
|
35
|
+
|
36
|
+
<a href="_index.html">Index (T)</a> »
|
37
|
+
|
38
|
+
|
39
|
+
<span class="title">Trackerific</span>
|
40
|
+
|
41
|
+
|
42
|
+
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
43
|
+
</div>
|
44
|
+
|
45
|
+
<div id="search">
|
46
|
+
|
47
|
+
<a id="class_list_link" href="#">Class List</a>
|
48
|
+
|
49
|
+
<a id="method_list_link" href="#">Method List</a>
|
50
|
+
|
51
|
+
<a id="file_list_link" href="#">File List</a>
|
52
|
+
|
53
|
+
</div>
|
54
|
+
<div class="clear"></div>
|
55
|
+
</div>
|
56
|
+
|
57
|
+
<iframe id="search_frame"></iframe>
|
58
|
+
|
59
|
+
<div id="content"><h1>Module: Trackerific
|
60
|
+
|
61
|
+
|
62
|
+
|
63
|
+
</h1>
|
64
|
+
|
65
|
+
<dl class="box">
|
66
|
+
|
67
|
+
|
68
|
+
|
69
|
+
|
70
|
+
|
71
|
+
|
72
|
+
|
73
|
+
|
74
|
+
<dt class="r1 last">Defined in:</dt>
|
75
|
+
<dd class="r1 last">lib/trackerific.rb<span class="defines">,<br />
|
76
|
+
lib/ups.rb,<br /> lib/usps.rb,<br /> lib/fedex.rb,<br /> lib/trackerific_event.rb,<br /> lib/trackerific_details.rb</span>
|
77
|
+
</dd>
|
78
|
+
|
79
|
+
</dl>
|
80
|
+
<div class="clear"></div>
|
81
|
+
|
82
|
+
<h2>Overview</h2><div class="docstring">
|
83
|
+
<div class="discussion">
|
84
|
+
<p>
|
85
|
+
Trackerific is a UPS, FedEx and USPS tracking provider.
|
86
|
+
</p>
|
87
|
+
|
88
|
+
|
89
|
+
</div>
|
90
|
+
</div>
|
91
|
+
<div class="tags">
|
92
|
+
|
93
|
+
</div><h2>Defined Under Namespace</h2>
|
94
|
+
<p class="children">
|
95
|
+
|
96
|
+
|
97
|
+
|
98
|
+
|
99
|
+
<strong class="classes">Classes:</strong> <span class='object_link'><a href="Trackerific/Base.html" title="Trackerific::Base (class)">Base</a></span>, <span class='object_link'><a href="Trackerific/Details.html" title="Trackerific::Details (class)">Details</a></span>, <span class='object_link'><a href="Trackerific/Error.html" title="Trackerific::Error (class)">Error</a></span>, <span class='object_link'><a href="Trackerific/Event.html" title="Trackerific::Event (class)">Event</a></span>, <span class='object_link'><a href="Trackerific/FedEx.html" title="Trackerific::FedEx (class)">FedEx</a></span>, <span class='object_link'><a href="Trackerific/UPS.html" title="Trackerific::UPS (class)">UPS</a></span>, <span class='object_link'><a href="Trackerific/USPS.html" title="Trackerific::USPS (class)">USPS</a></span>
|
100
|
+
|
101
|
+
|
102
|
+
</p>
|
103
|
+
|
104
|
+
|
105
|
+
|
106
|
+
|
107
|
+
|
108
|
+
|
109
|
+
<h2>
|
110
|
+
Instance Method Summary
|
111
|
+
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
112
|
+
</h2>
|
113
|
+
|
114
|
+
<ul class="summary">
|
115
|
+
|
116
|
+
<li class="public ">
|
117
|
+
<span class="summary_signature">
|
118
|
+
|
119
|
+
<a href="#tracking_service-instance_method" title="#tracking_service (instance method)">- (Trackerific::Base) <strong>tracking_service</strong>(package_id) </a>
|
120
|
+
|
121
|
+
|
122
|
+
|
123
|
+
</span>
|
124
|
+
|
125
|
+
|
126
|
+
|
127
|
+
|
128
|
+
|
129
|
+
|
130
|
+
|
131
|
+
|
132
|
+
<span class="summary_desc"><div class='inline'><p>
|
133
|
+
Checks a string for a valid package identifier, and returns a Trackerific
|
134
|
+
class that should be able to track the package.
|
135
|
+
</p>
|
136
|
+
</div></span>
|
137
|
+
|
138
|
+
</li>
|
139
|
+
|
140
|
+
|
141
|
+
</ul>
|
142
|
+
|
143
|
+
|
144
|
+
|
145
|
+
|
146
|
+
<div id="instance_method_details" class="method_details_list">
|
147
|
+
<h2>Instance Method Details</h2>
|
148
|
+
|
149
|
+
|
150
|
+
<div class="method_details first">
|
151
|
+
<p class="signature first" id="tracking_service-instance_method">
|
152
|
+
|
153
|
+
- (<tt><span class='object_link'><a href="Trackerific/Base.html" title="Trackerific::Base (class)">Trackerific::Base</a></span></tt>) <strong>tracking_service</strong>(package_id)
|
154
|
+
|
155
|
+
|
156
|
+
|
157
|
+
</p><div class="docstring">
|
158
|
+
<div class="discussion">
|
159
|
+
<p>
|
160
|
+
Checks a string for a valid package identifier, and returns a Trackerific
|
161
|
+
class that should be able to track the package.
|
162
|
+
</p>
|
163
|
+
|
164
|
+
|
165
|
+
</div>
|
166
|
+
</div>
|
167
|
+
<div class="tags">
|
168
|
+
<h3>Parameters:</h3>
|
169
|
+
<ul class="param">
|
170
|
+
|
171
|
+
<li>
|
172
|
+
|
173
|
+
<span class='name'>the</span>
|
174
|
+
|
175
|
+
|
176
|
+
<span class='type'>(<tt>String</tt>)</span>
|
177
|
+
|
178
|
+
|
179
|
+
|
180
|
+
—
|
181
|
+
<div class='inline'><p>
|
182
|
+
package identifier.
|
183
|
+
</p>
|
184
|
+
</div>
|
185
|
+
|
186
|
+
</li>
|
187
|
+
|
188
|
+
</ul>
|
189
|
+
<h3>Returns:</h3>
|
190
|
+
<ul class="return">
|
191
|
+
|
192
|
+
<li>
|
193
|
+
|
194
|
+
|
195
|
+
<span class='type'>(<tt><span class='object_link'><a href="Trackerific/Base.html" title="Trackerific::Base (class)">Trackerific::Base</a></span></tt>)</span>
|
196
|
+
|
197
|
+
|
198
|
+
|
199
|
+
—
|
200
|
+
<div class='inline'><p>
|
201
|
+
the Trackerific class that can track the given package id, or nil if none
|
202
|
+
found.
|
203
|
+
</p>
|
204
|
+
</div>
|
205
|
+
|
206
|
+
</li>
|
207
|
+
|
208
|
+
</ul>
|
209
|
+
|
210
|
+
</div><table class="source_code">
|
211
|
+
<tr>
|
212
|
+
<td>
|
213
|
+
<pre class="lines">
|
214
|
+
|
215
|
+
|
216
|
+
46
|
217
|
+
47
|
218
|
+
48
|
219
|
+
49
|
220
|
+
50
|
221
|
+
51
|
222
|
+
52
|
223
|
+
53
|
224
|
+
54
|
225
|
+
55
|
226
|
+
56</pre>
|
227
|
+
</td>
|
228
|
+
<td>
|
229
|
+
<pre class="code"><span class="info file"># File 'lib/trackerific.rb', line 46</span>
|
230
|
+
|
231
|
+
<span class='kw'>def</span> <span class='id tracking_service'>tracking_service</span><span class='lparen'>(</span><span class='id package_id'>package_id</span><span class='rparen'>)</span>
|
232
|
+
<span class='kw'>case</span> <span class='id package_id'>package_id</span>
|
233
|
+
<span class='kw'>when</span> <span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>^.Z</span><span class='regexp_end'>/</span></span><span class='comma'>,</span> <span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>^[HK].{10}$</span><span class='regexp_end'>/</span></span> <span class='kw'>then</span> <span class='const'>Trackerific</span><span class='op'>::</span><span class='const'>UPS</span>
|
234
|
+
<span class='kw'>when</span> <span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>^96.{20}$</span><span class='regexp_end'>/</span></span> <span class='kw'>then</span> <span class='const'>Trackerific</span><span class='op'>::</span><span class='const'>FedEx</span>
|
235
|
+
<span class='kw'>else</span> <span class='kw'>case</span> <span class='id package_id'>package_id</span><span class='period'>.</span><span class='id length'>length</span>
|
236
|
+
<span class='kw'>when</span> <span class='int'>13</span><span class='comma'>,</span> <span class='int'>20</span><span class='comma'>,</span> <span class='int'>22</span><span class='comma'>,</span> <span class='int'>30</span> <span class='kw'>then</span> <span class='const'>Trackerific</span><span class='op'>::</span><span class='const'>USPS</span>
|
237
|
+
<span class='kw'>when</span> <span class='int'>12</span><span class='comma'>,</span> <span class='int'>15</span><span class='comma'>,</span> <span class='int'>19</span> <span class='kw'>then</span> <span class='const'>Trackerific</span><span class='op'>::</span><span class='const'>FedEx</span>
|
238
|
+
<span class='kw'>else</span> <span class='kw'>nil</span>
|
239
|
+
<span class='kw'>end</span>
|
240
|
+
<span class='kw'>end</span>
|
241
|
+
<span class='kw'>end</span></pre>
|
242
|
+
</td>
|
243
|
+
</tr>
|
244
|
+
</table>
|
245
|
+
</div>
|
246
|
+
|
247
|
+
</div>
|
248
|
+
|
249
|
+
</div>
|
250
|
+
|
251
|
+
<div id="footer">
|
252
|
+
Generated on Mon Jun 13 13:53:33 2011 by
|
253
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
254
|
+
0.7.1 (ruby-1.9.2).
|
255
|
+
</div>
|
256
|
+
|
257
|
+
</body>
|
258
|
+
</html>
|
@@ -0,0 +1,390 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
2
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
3
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
4
|
+
<head>
|
5
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
6
|
+
<title>
|
7
|
+
Class: Trackerific::Base
|
8
|
+
|
9
|
+
— Documentation by YARD 0.7.1
|
10
|
+
|
11
|
+
</title>
|
12
|
+
|
13
|
+
<link rel="stylesheet" href="../css/style.css" type="text/css" media="screen" charset="utf-8" />
|
14
|
+
|
15
|
+
<link rel="stylesheet" href="../css/common.css" type="text/css" media="screen" charset="utf-8" />
|
16
|
+
|
17
|
+
<script type="text/javascript" charset="utf-8">
|
18
|
+
relpath = '..';
|
19
|
+
if (relpath != '') relpath += '/';
|
20
|
+
</script>
|
21
|
+
|
22
|
+
<script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
|
23
|
+
|
24
|
+
<script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
|
25
|
+
|
26
|
+
|
27
|
+
</head>
|
28
|
+
<body>
|
29
|
+
<script type="text/javascript" charset="utf-8">
|
30
|
+
if (window.top.frames.main) document.body.className = 'frames';
|
31
|
+
</script>
|
32
|
+
|
33
|
+
<div id="header">
|
34
|
+
<div id="menu">
|
35
|
+
|
36
|
+
<a href="../_index.html">Index (B)</a> »
|
37
|
+
<span class='title'><span class='object_link'><a href="../Trackerific.html" title="Trackerific (module)">Trackerific</a></span></span>
|
38
|
+
»
|
39
|
+
<span class="title">Base</span>
|
40
|
+
|
41
|
+
|
42
|
+
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
43
|
+
</div>
|
44
|
+
|
45
|
+
<div id="search">
|
46
|
+
|
47
|
+
<a id="class_list_link" href="#">Class List</a>
|
48
|
+
|
49
|
+
<a id="method_list_link" href="#">Method List</a>
|
50
|
+
|
51
|
+
<a id="file_list_link" href="#">File List</a>
|
52
|
+
|
53
|
+
</div>
|
54
|
+
<div class="clear"></div>
|
55
|
+
</div>
|
56
|
+
|
57
|
+
<iframe id="search_frame"></iframe>
|
58
|
+
|
59
|
+
<div id="content"><h1>Class: Trackerific::Base
|
60
|
+
|
61
|
+
|
62
|
+
|
63
|
+
</h1>
|
64
|
+
|
65
|
+
<dl class="box">
|
66
|
+
|
67
|
+
<dt class="r1">Inherits:</dt>
|
68
|
+
<dd class="r1">
|
69
|
+
<span class="inheritName">Object</span>
|
70
|
+
|
71
|
+
<ul class="fullTree">
|
72
|
+
<li>Object</li>
|
73
|
+
|
74
|
+
<li class="next">Trackerific::Base</li>
|
75
|
+
|
76
|
+
</ul>
|
77
|
+
<a href="#" class="inheritanceTree">show all</a>
|
78
|
+
|
79
|
+
</dd>
|
80
|
+
|
81
|
+
|
82
|
+
|
83
|
+
|
84
|
+
|
85
|
+
|
86
|
+
|
87
|
+
|
88
|
+
|
89
|
+
<dt class="r2 last">Defined in:</dt>
|
90
|
+
<dd class="r2 last">lib/trackerific.rb</dd>
|
91
|
+
|
92
|
+
</dl>
|
93
|
+
<div class="clear"></div>
|
94
|
+
|
95
|
+
<h2>Overview</h2><div class="docstring">
|
96
|
+
<div class="discussion">
|
97
|
+
<p>
|
98
|
+
Base class for Trackerific tracking services.
|
99
|
+
</p>
|
100
|
+
|
101
|
+
|
102
|
+
</div>
|
103
|
+
</div>
|
104
|
+
<div class="tags">
|
105
|
+
|
106
|
+
</div><div id="subclasses">
|
107
|
+
<h2>Direct Known Subclasses</h2>
|
108
|
+
<p class="children"><span class='object_link'><a href="FedEx.html" title="Trackerific::FedEx (class)">FedEx</a></span>, <span class='object_link'><a href="UPS.html" title="Trackerific::UPS (class)">UPS</a></span>, <span class='object_link'><a href="USPS.html" title="Trackerific::USPS (class)">USPS</a></span></p>
|
109
|
+
</div>
|
110
|
+
|
111
|
+
|
112
|
+
|
113
|
+
|
114
|
+
|
115
|
+
|
116
|
+
<h2>
|
117
|
+
Instance Method Summary
|
118
|
+
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
119
|
+
</h2>
|
120
|
+
|
121
|
+
<ul class="summary">
|
122
|
+
|
123
|
+
<li class="public ">
|
124
|
+
<span class="summary_signature">
|
125
|
+
|
126
|
+
<a href="#initialize-instance_method" title="#initialize (instance method)">- (Base) <strong>initialize</strong>(options = {}) </a>
|
127
|
+
|
128
|
+
|
129
|
+
|
130
|
+
</span>
|
131
|
+
|
132
|
+
<span class="note title constructor">constructor</span>
|
133
|
+
|
134
|
+
|
135
|
+
|
136
|
+
|
137
|
+
|
138
|
+
|
139
|
+
|
140
|
+
|
141
|
+
<span class="summary_desc"><div class='inline'><p>
|
142
|
+
A new instance of Base.
|
143
|
+
</p>
|
144
|
+
</div></span>
|
145
|
+
|
146
|
+
</li>
|
147
|
+
|
148
|
+
|
149
|
+
<li class="public ">
|
150
|
+
<span class="summary_signature">
|
151
|
+
|
152
|
+
<a href="#required_options-instance_method" title="#required_options (instance method)">- (Array) <strong>required_options</strong> </a>
|
153
|
+
|
154
|
+
|
155
|
+
|
156
|
+
</span>
|
157
|
+
|
158
|
+
|
159
|
+
|
160
|
+
|
161
|
+
|
162
|
+
|
163
|
+
|
164
|
+
|
165
|
+
<span class="summary_desc"><div class='inline'><p>
|
166
|
+
Override this method if your subclass has required options.
|
167
|
+
</p>
|
168
|
+
</div></span>
|
169
|
+
|
170
|
+
</li>
|
171
|
+
|
172
|
+
|
173
|
+
<li class="public ">
|
174
|
+
<span class="summary_signature">
|
175
|
+
|
176
|
+
<a href="#track_package-instance_method" title="#track_package (instance method)">- (Hash) <strong>track_package</strong>(package_id) </a>
|
177
|
+
|
178
|
+
|
179
|
+
|
180
|
+
</span>
|
181
|
+
|
182
|
+
|
183
|
+
|
184
|
+
|
185
|
+
|
186
|
+
|
187
|
+
|
188
|
+
|
189
|
+
<span class="summary_desc"><div class='inline'><p>
|
190
|
+
Override this method in your subclass to implement tracking a package.
|
191
|
+
</p>
|
192
|
+
</div></span>
|
193
|
+
|
194
|
+
</li>
|
195
|
+
|
196
|
+
|
197
|
+
</ul>
|
198
|
+
|
199
|
+
|
200
|
+
<div id="constructor_details" class="method_details_list">
|
201
|
+
<h2>Constructor Details</h2>
|
202
|
+
|
203
|
+
<div class="method_details first">
|
204
|
+
<p class="signature first" id="initialize-instance_method">
|
205
|
+
|
206
|
+
- (<tt><span class='object_link'><a href="" title="Trackerific::Base (class)">Base</a></span></tt>) <strong>initialize</strong>(options = {})
|
207
|
+
|
208
|
+
|
209
|
+
|
210
|
+
</p><div class="docstring">
|
211
|
+
<div class="discussion">
|
212
|
+
<p>
|
213
|
+
A new instance of Base
|
214
|
+
</p>
|
215
|
+
|
216
|
+
|
217
|
+
</div>
|
218
|
+
</div>
|
219
|
+
<div class="tags">
|
220
|
+
|
221
|
+
</div><table class="source_code">
|
222
|
+
<tr>
|
223
|
+
<td>
|
224
|
+
<pre class="lines">
|
225
|
+
|
226
|
+
|
227
|
+
12
|
228
|
+
13
|
229
|
+
14
|
230
|
+
15
|
231
|
+
16
|
232
|
+
17
|
233
|
+
18
|
234
|
+
19
|
235
|
+
20
|
236
|
+
21</pre>
|
237
|
+
</td>
|
238
|
+
<td>
|
239
|
+
<pre class="code"><span class="info file"># File 'lib/trackerific.rb', line 12</span>
|
240
|
+
|
241
|
+
<span class='kw'>def</span> <span class='id initialize'>initialize</span><span class='lparen'>(</span><span class='id options'>options</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
|
242
|
+
<span class='id required'>required</span> <span class='op'>=</span> <span class='id required_options'>required_options</span>
|
243
|
+
<span class='id required'>required</span><span class='period'>.</span><span class='id each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id k'>k</span><span class='op'>|</span>
|
244
|
+
<span class='id raise'>raise</span> <span class='const'>ArgumentError</span><span class='period'>.</span><span class='id new'>new</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Missing required parameter: </span><span class='embexpr_beg'>#{</span><span class='id k'>k</span><span class='rbrace'>}</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span> <span class='kw'>unless</span> <span class='id options'>options</span><span class='period'>.</span><span class='id has_key?'>has_key?</span><span class='lparen'>(</span><span class='id k'>k</span><span class='rparen'>)</span>
|
245
|
+
<span class='kw'>end</span>
|
246
|
+
<span class='id options'>options</span><span class='period'>.</span><span class='id each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id k'>k</span><span class='comma'>,</span> <span class='id v'>v</span><span class='op'>|</span>
|
247
|
+
<span class='id raise'>raise</span> <span class='const'>ArgumentError</span><span class='period'>.</span><span class='id new'>new</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Invalid parameter: </span><span class='embexpr_beg'>#{</span><span class='id k'>k</span><span class='rbrace'>}</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span> <span class='kw'>unless</span> <span class='id required'>required</span><span class='period'>.</span><span class='id include?'>include?</span><span class='lparen'>(</span><span class='id k'>k</span><span class='rparen'>)</span>
|
248
|
+
<span class='kw'>end</span>
|
249
|
+
<span class='ivar'>@options</span> <span class='op'>=</span> <span class='id options'>options</span>
|
250
|
+
<span class='kw'>end</span></pre>
|
251
|
+
</td>
|
252
|
+
</tr>
|
253
|
+
</table>
|
254
|
+
</div>
|
255
|
+
|
256
|
+
</div>
|
257
|
+
|
258
|
+
|
259
|
+
<div id="instance_method_details" class="method_details_list">
|
260
|
+
<h2>Instance Method Details</h2>
|
261
|
+
|
262
|
+
|
263
|
+
<div class="method_details first">
|
264
|
+
<p class="signature first" id="required_options-instance_method">
|
265
|
+
|
266
|
+
- (<tt>Array</tt>) <strong>required_options</strong>
|
267
|
+
|
268
|
+
|
269
|
+
|
270
|
+
</p><div class="docstring">
|
271
|
+
<div class="discussion">
|
272
|
+
<p>
|
273
|
+
Override this method if your subclass has required options.
|
274
|
+
</p>
|
275
|
+
|
276
|
+
|
277
|
+
</div>
|
278
|
+
</div>
|
279
|
+
<div class="tags">
|
280
|
+
<h3>Returns:</h3>
|
281
|
+
<ul class="return">
|
282
|
+
|
283
|
+
<li>
|
284
|
+
|
285
|
+
|
286
|
+
<span class='type'>(<tt>Array</tt>)</span>
|
287
|
+
|
288
|
+
|
289
|
+
|
290
|
+
—
|
291
|
+
<div class='inline'><p>
|
292
|
+
the required options
|
293
|
+
</p>
|
294
|
+
</div>
|
295
|
+
|
296
|
+
</li>
|
297
|
+
|
298
|
+
</ul>
|
299
|
+
|
300
|
+
</div><table class="source_code">
|
301
|
+
<tr>
|
302
|
+
<td>
|
303
|
+
<pre class="lines">
|
304
|
+
|
305
|
+
|
306
|
+
25
|
307
|
+
26
|
308
|
+
27</pre>
|
309
|
+
</td>
|
310
|
+
<td>
|
311
|
+
<pre class="code"><span class="info file"># File 'lib/trackerific.rb', line 25</span>
|
312
|
+
|
313
|
+
<span class='kw'>def</span> <span class='id required_options'>required_options</span>
|
314
|
+
<span class='lbracket'>[</span><span class='rbracket'>]</span>
|
315
|
+
<span class='kw'>end</span></pre>
|
316
|
+
</td>
|
317
|
+
</tr>
|
318
|
+
</table>
|
319
|
+
</div>
|
320
|
+
|
321
|
+
<div class="method_details ">
|
322
|
+
<p class="signature " id="track_package-instance_method">
|
323
|
+
|
324
|
+
- (<tt>Hash</tt>) <strong>track_package</strong>(package_id)
|
325
|
+
|
326
|
+
|
327
|
+
|
328
|
+
</p><div class="docstring">
|
329
|
+
<div class="discussion">
|
330
|
+
<p>
|
331
|
+
Override this method in your subclass to implement tracking a package.
|
332
|
+
</p>
|
333
|
+
|
334
|
+
|
335
|
+
</div>
|
336
|
+
</div>
|
337
|
+
<div class="tags">
|
338
|
+
<h3>Returns:</h3>
|
339
|
+
<ul class="return">
|
340
|
+
|
341
|
+
<li>
|
342
|
+
|
343
|
+
|
344
|
+
<span class='type'>(<tt>Hash</tt>)</span>
|
345
|
+
|
346
|
+
|
347
|
+
|
348
|
+
—
|
349
|
+
<div class='inline'><p>
|
350
|
+
the tracking details
|
351
|
+
</p>
|
352
|
+
</div>
|
353
|
+
|
354
|
+
</li>
|
355
|
+
|
356
|
+
</ul>
|
357
|
+
|
358
|
+
</div><table class="source_code">
|
359
|
+
<tr>
|
360
|
+
<td>
|
361
|
+
<pre class="lines">
|
362
|
+
|
363
|
+
|
364
|
+
31
|
365
|
+
32
|
366
|
+
33</pre>
|
367
|
+
</td>
|
368
|
+
<td>
|
369
|
+
<pre class="code"><span class="info file"># File 'lib/trackerific.rb', line 31</span>
|
370
|
+
|
371
|
+
<span class='kw'>def</span> <span class='id track_package'>track_package</span><span class='lparen'>(</span><span class='id package_id'>package_id</span><span class='rparen'>)</span>
|
372
|
+
<span class='ivar'>@package_id</span> <span class='op'>=</span> <span class='id package_id'>package_id</span>
|
373
|
+
<span class='kw'>end</span></pre>
|
374
|
+
</td>
|
375
|
+
</tr>
|
376
|
+
</table>
|
377
|
+
</div>
|
378
|
+
|
379
|
+
</div>
|
380
|
+
|
381
|
+
</div>
|
382
|
+
|
383
|
+
<div id="footer">
|
384
|
+
Generated on Mon Jun 13 13:53:34 2011 by
|
385
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
386
|
+
0.7.1 (ruby-1.9.2).
|
387
|
+
</div>
|
388
|
+
|
389
|
+
</body>
|
390
|
+
</html>
|