trackerific 0.3.2 → 0.3.3
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +1 -0
- data/Gemfile.lock +40 -38
- data/README.rdoc +4 -9
- data/VERSION +1 -1
- data/doc/Trackerific.html +34 -22
- data/doc/Trackerific/Base.html +237 -20
- data/doc/Trackerific/Details.html +6 -6
- data/doc/Trackerific/Error.html +2 -2
- data/doc/Trackerific/Event.html +7 -7
- data/doc/Trackerific/FedEx.html +190 -3
- data/doc/Trackerific/UPS.html +190 -3
- data/doc/Trackerific/USPS.html +190 -3
- data/doc/_index.html +1 -1
- data/doc/file.README.html +6 -24
- data/doc/index.html +6 -24
- data/doc/method_list.html +68 -4
- data/doc/top-level-namespace.html +1 -1
- data/lib/trackerific.rb +37 -74
- data/lib/trackerific/base.rb +70 -0
- data/lib/{trackerific_details.rb → trackerific/details.rb} +0 -0
- data/lib/trackerific/error.rb +4 -0
- data/lib/{trackerific_event.rb → trackerific/event.rb} +0 -0
- data/lib/{fedex.rb → trackerific/services/fedex.rb} +9 -2
- data/lib/{ups.rb → trackerific/services/ups.rb} +10 -4
- data/lib/{usps.rb → trackerific/services/usps.rb} +10 -3
- data/spec/lib/trackerific/base_spec.rb +34 -0
- data/spec/lib/{trackerific_details_spec.rb → trackerific/details_spec.rb} +0 -0
- data/spec/lib/trackerific/error_spec.rb +5 -0
- data/spec/lib/{trackerific_event_spec.rb → trackerific/event_spec.rb} +0 -0
- data/spec/lib/{fedex_spec.rb → trackerific/services/fedex_spec.rb} +19 -14
- data/spec/lib/{ups_spec.rb → trackerific/services/ups_spec.rb} +20 -14
- data/spec/lib/{usps_spec.rb → trackerific/services/usps_spec.rb} +18 -14
- data/spec/lib/trackerific_spec.rb +7 -30
- data/spec/spec_helper.rb +1 -0
- data/trackerific.gemspec +18 -22
- metadata +38 -27
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -2,77 +2,77 @@ GEM
|
|
2
2
|
remote: http://rubygems.org/
|
3
3
|
specs:
|
4
4
|
abstract (1.0.0)
|
5
|
-
actionmailer (3.0.
|
6
|
-
actionpack (= 3.0.
|
7
|
-
mail (~> 2.2.
|
8
|
-
actionpack (3.0.
|
9
|
-
activemodel (= 3.0.
|
10
|
-
activesupport (= 3.0.
|
5
|
+
actionmailer (3.0.8)
|
6
|
+
actionpack (= 3.0.8)
|
7
|
+
mail (~> 2.2.19)
|
8
|
+
actionpack (3.0.8)
|
9
|
+
activemodel (= 3.0.8)
|
10
|
+
activesupport (= 3.0.8)
|
11
11
|
builder (~> 2.1.2)
|
12
12
|
erubis (~> 2.6.6)
|
13
|
-
i18n (~> 0.
|
13
|
+
i18n (~> 0.5.0)
|
14
14
|
rack (~> 1.2.1)
|
15
|
-
rack-mount (~> 0.6.
|
15
|
+
rack-mount (~> 0.6.14)
|
16
16
|
rack-test (~> 0.5.7)
|
17
17
|
tzinfo (~> 0.3.23)
|
18
|
-
activemodel (3.0.
|
19
|
-
activesupport (= 3.0.
|
18
|
+
activemodel (3.0.8)
|
19
|
+
activesupport (= 3.0.8)
|
20
20
|
builder (~> 2.1.2)
|
21
|
-
i18n (~> 0.
|
22
|
-
activerecord (3.0.
|
23
|
-
activemodel (= 3.0.
|
24
|
-
activesupport (= 3.0.
|
25
|
-
arel (~> 2.0.
|
21
|
+
i18n (~> 0.5.0)
|
22
|
+
activerecord (3.0.8)
|
23
|
+
activemodel (= 3.0.8)
|
24
|
+
activesupport (= 3.0.8)
|
25
|
+
arel (~> 2.0.10)
|
26
26
|
tzinfo (~> 0.3.23)
|
27
|
-
activeresource (3.0.
|
28
|
-
activemodel (= 3.0.
|
29
|
-
activesupport (= 3.0.
|
30
|
-
activesupport (3.0.
|
27
|
+
activeresource (3.0.8)
|
28
|
+
activemodel (= 3.0.8)
|
29
|
+
activesupport (= 3.0.8)
|
30
|
+
activesupport (3.0.8)
|
31
31
|
archive-tar-minitar (0.5.2)
|
32
|
-
arel (2.0.
|
32
|
+
arel (2.0.10)
|
33
33
|
builder (2.1.2)
|
34
|
-
columnize (0.3.
|
34
|
+
columnize (0.3.3)
|
35
35
|
crack (0.1.8)
|
36
36
|
diff-lcs (1.1.2)
|
37
37
|
erubis (2.6.6)
|
38
38
|
abstract (>= 1.0.0)
|
39
39
|
fakeweb (1.3.0)
|
40
40
|
git (1.2.5)
|
41
|
-
httparty (0.7.
|
41
|
+
httparty (0.7.8)
|
42
42
|
crack (= 0.1.8)
|
43
43
|
i18n (0.5.0)
|
44
|
-
jeweler (1.
|
45
|
-
bundler (~> 1.0
|
44
|
+
jeweler (1.6.2)
|
45
|
+
bundler (~> 1.0)
|
46
46
|
git (>= 1.2.5)
|
47
47
|
rake
|
48
48
|
linecache19 (0.5.12)
|
49
49
|
ruby_core_source (>= 0.1.4)
|
50
|
-
mail (2.2.
|
50
|
+
mail (2.2.19)
|
51
51
|
activesupport (>= 2.3.6)
|
52
52
|
i18n (>= 0.4.0)
|
53
53
|
mime-types (~> 1.16)
|
54
54
|
treetop (~> 1.4.8)
|
55
55
|
mime-types (1.16)
|
56
56
|
polyglot (0.3.1)
|
57
|
-
rack (1.2.
|
57
|
+
rack (1.2.3)
|
58
58
|
rack-mount (0.6.14)
|
59
59
|
rack (>= 1.0.0)
|
60
60
|
rack-test (0.5.7)
|
61
61
|
rack (>= 1.0)
|
62
|
-
rails (3.0.
|
63
|
-
actionmailer (= 3.0.
|
64
|
-
actionpack (= 3.0.
|
65
|
-
activerecord (= 3.0.
|
66
|
-
activeresource (= 3.0.
|
67
|
-
activesupport (= 3.0.
|
62
|
+
rails (3.0.8)
|
63
|
+
actionmailer (= 3.0.8)
|
64
|
+
actionpack (= 3.0.8)
|
65
|
+
activerecord (= 3.0.8)
|
66
|
+
activeresource (= 3.0.8)
|
67
|
+
activesupport (= 3.0.8)
|
68
68
|
bundler (~> 1.0)
|
69
|
-
railties (= 3.0.
|
70
|
-
railties (3.0.
|
71
|
-
actionpack (= 3.0.
|
72
|
-
activesupport (= 3.0.
|
69
|
+
railties (= 3.0.8)
|
70
|
+
railties (3.0.8)
|
71
|
+
actionpack (= 3.0.8)
|
72
|
+
activesupport (= 3.0.8)
|
73
73
|
rake (>= 0.8.7)
|
74
74
|
thor (~> 0.14.4)
|
75
|
-
rake (0.
|
75
|
+
rake (0.9.2)
|
76
76
|
rspec (2.6.0)
|
77
77
|
rspec-core (~> 2.6.0)
|
78
78
|
rspec-expectations (~> 2.6.0)
|
@@ -86,6 +86,7 @@ GEM
|
|
86
86
|
activesupport (~> 3.0)
|
87
87
|
railties (~> 3.0)
|
88
88
|
rspec (~> 2.6.0)
|
89
|
+
rspec_multi_matchers (1.1.0)
|
89
90
|
ruby-debug-base19 (0.11.25)
|
90
91
|
columnize (>= 0.3.1)
|
91
92
|
linecache19 (>= 0.5.11)
|
@@ -99,7 +100,7 @@ GEM
|
|
99
100
|
thor (0.14.6)
|
100
101
|
treetop (1.4.9)
|
101
102
|
polyglot (>= 0.3.1)
|
102
|
-
tzinfo (0.3.
|
103
|
+
tzinfo (0.3.28)
|
103
104
|
yard (0.7.1)
|
104
105
|
yardstick (0.4.0)
|
105
106
|
yard (~> 0.7.0)
|
@@ -115,5 +116,6 @@ DEPENDENCIES
|
|
115
116
|
jeweler (>= 1.5.2)
|
116
117
|
rails (>= 3.0.0)
|
117
118
|
rspec-rails (>= 2.6.1)
|
119
|
+
rspec_multi_matchers (>= 1.1.0)
|
118
120
|
ruby-debug19 (>= 0.11.6)
|
119
121
|
yardstick (>= 0.4.0)
|
data/README.rdoc
CHANGED
@@ -73,18 +73,13 @@ example on how to handle Trackerific::Errors:
|
|
73
73
|
|
74
74
|
== Contributing to trackerific
|
75
75
|
|
76
|
-
* Check out the latest master to make sure the feature hasn't been implemented
|
77
|
-
|
78
|
-
* Check out the issue tracker to make sure someone already hasn't requested it
|
79
|
-
and/or contributed it
|
76
|
+
* Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
|
77
|
+
* Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it
|
80
78
|
* Fork the project
|
81
79
|
* Start a feature/bugfix branch
|
82
80
|
* Commit and push until you are happy with your contribution
|
83
|
-
* Make sure to add tests for it. This is important so I don't break it in a
|
84
|
-
|
85
|
-
* Please try not to mess with the Rakefile, version, or history. If you want to
|
86
|
-
have your own version, or is otherwise necessary, that is fine, but please
|
87
|
-
isolate to its own commit so I can cherry-pick around it.
|
81
|
+
* Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
|
82
|
+
* Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
|
88
83
|
|
89
84
|
== Copyright
|
90
85
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.3.
|
1
|
+
0.3.3
|
data/doc/Trackerific.html
CHANGED
@@ -73,7 +73,7 @@
|
|
73
73
|
|
74
74
|
<dt class="r1 last">Defined in:</dt>
|
75
75
|
<dd class="r1 last">lib/trackerific.rb<span class="defines">,<br />
|
76
|
-
lib/
|
76
|
+
lib/trackerific/base.rb,<br /> lib/trackerific/event.rb,<br /> lib/trackerific/error.rb,<br /> lib/trackerific/details.rb,<br /> lib/trackerific/services/ups.rb,<br /> lib/trackerific/services/usps.rb,<br /> lib/trackerific/services/fedex.rb</span>
|
77
77
|
</dd>
|
78
78
|
|
79
79
|
</dl>
|
@@ -82,7 +82,7 @@
|
|
82
82
|
<h2>Overview</h2><div class="docstring">
|
83
83
|
<div class="discussion">
|
84
84
|
<p>
|
85
|
-
Trackerific
|
85
|
+
Trackerific provides package tracking to Rails apps.
|
86
86
|
</p>
|
87
87
|
|
88
88
|
|
@@ -223,31 +223,43 @@ found.
|
|
223
223
|
<pre class="lines">
|
224
224
|
|
225
225
|
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
226
|
+
21
|
227
|
+
22
|
228
|
+
23
|
229
|
+
24
|
230
|
+
25
|
231
|
+
26
|
232
|
+
27
|
233
|
+
28
|
234
|
+
29
|
235
|
+
30
|
236
|
+
31
|
237
|
+
32
|
238
|
+
33
|
239
|
+
34
|
240
|
+
35
|
241
|
+
36
|
242
|
+
37</pre>
|
237
243
|
</td>
|
238
244
|
<td>
|
239
|
-
<pre class="code"><span class="info file"># File 'lib/trackerific.rb', line
|
245
|
+
<pre class="code"><span class="info file"># File 'lib/trackerific.rb', line 21</span>
|
240
246
|
|
241
247
|
<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>
|
242
|
-
<span class='
|
243
|
-
|
244
|
-
<span class='
|
245
|
-
<span class='
|
246
|
-
|
247
|
-
|
248
|
-
<span class='
|
248
|
+
<span class='comment'># loop through each constant in Trackerific
|
249
|
+
</span> <span class='const'>Trackerific</span><span class='period'>.</span><span class='id constants'>constants</span><span class='period'>.</span><span class='id each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id const'>const</span><span class='op'>|</span>
|
250
|
+
<span class='comment'># get the constant's class
|
251
|
+
</span> <span class='id cls'>cls</span> <span class='op'>=</span> <span class='const'>Trackerific</span><span class='period'>.</span><span class='id const_get'>const_get</span><span class='lparen'>(</span><span class='id const'>const</span><span class='rparen'>)</span>
|
252
|
+
<span class='comment'># check if it descends from Trackerific::Base
|
253
|
+
</span> <span class='kw'>if</span> <span class='id cls'>cls</span><span class='period'>.</span><span class='id superclass'>superclass</span> <span class='op'>==</span> <span class='const'>Trackerific</span><span class='op'>::</span><span class='const'>Base</span>
|
254
|
+
<span class='comment'># loop through each package id matcher
|
255
|
+
</span> <span class='id cls'>cls</span><span class='period'>.</span><span class='id package_id_matchers'>package_id_matchers</span><span class='period'>.</span><span class='id each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id matcher'>matcher</span><span class='op'>|</span>
|
256
|
+
<span class='comment'># return the class if it matches
|
257
|
+
</span> <span class='kw'>return</span> <span class='id cls'>cls</span> <span class='kw'>if</span> <span class='id package_id'>package_id</span> <span class='op'>=~</span> <span class='id matcher'>matcher</span>
|
258
|
+
<span class='kw'>end</span>
|
249
259
|
<span class='kw'>end</span>
|
250
260
|
<span class='kw'>end</span>
|
261
|
+
<span class='comment'># if we've made it this far, nothing matched
|
262
|
+
</span> <span class='kw'>nil</span>
|
251
263
|
<span class='kw'>end</span></pre>
|
252
264
|
</td>
|
253
265
|
</tr>
|
@@ -259,7 +271,7 @@ found.
|
|
259
271
|
</div>
|
260
272
|
|
261
273
|
<div id="footer">
|
262
|
-
Generated on Mon Jun 13
|
274
|
+
Generated on Mon Jun 13 21:28:36 2011 by
|
263
275
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
264
276
|
0.7.1 (ruby-1.9.2).
|
265
277
|
</div>
|
data/doc/Trackerific/Base.html
CHANGED
@@ -87,7 +87,7 @@
|
|
87
87
|
|
88
88
|
|
89
89
|
<dt class="r2 last">Defined in:</dt>
|
90
|
-
<dd class="r2 last">lib/trackerific.rb</dd>
|
90
|
+
<dd class="r2 last">lib/trackerific/base.rb</dd>
|
91
91
|
|
92
92
|
</dl>
|
93
93
|
<div class="clear"></div>
|
@@ -113,6 +113,64 @@ Base class for Trackerific package tracking services.
|
|
113
113
|
|
114
114
|
|
115
115
|
|
116
|
+
<h2>
|
117
|
+
Class 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="#package_id_matchers-class_method" title="package_id_matchers (class method)">+ (Array, Regexp) <strong>package_id_matchers</strong> </a>
|
127
|
+
|
128
|
+
|
129
|
+
|
130
|
+
</span>
|
131
|
+
|
132
|
+
|
133
|
+
|
134
|
+
|
135
|
+
|
136
|
+
|
137
|
+
|
138
|
+
|
139
|
+
<span class="summary_desc"><div class='inline'><p>
|
140
|
+
An Array of Regexp that matches valid package identifiers for your service.
|
141
|
+
</p>
|
142
|
+
</div></span>
|
143
|
+
|
144
|
+
</li>
|
145
|
+
|
146
|
+
|
147
|
+
<li class="public ">
|
148
|
+
<span class="summary_signature">
|
149
|
+
|
150
|
+
<a href="#required_options-class_method" title="required_options (class method)">+ (Array) <strong>required_options</strong> </a>
|
151
|
+
|
152
|
+
|
153
|
+
|
154
|
+
</span>
|
155
|
+
|
156
|
+
|
157
|
+
|
158
|
+
|
159
|
+
|
160
|
+
|
161
|
+
|
162
|
+
|
163
|
+
<span class="summary_desc"><div class='inline'><p>
|
164
|
+
An array of options that are required to create a new instance of this
|
165
|
+
class.
|
166
|
+
</p>
|
167
|
+
</div></span>
|
168
|
+
|
169
|
+
</li>
|
170
|
+
|
171
|
+
|
172
|
+
</ul>
|
173
|
+
|
116
174
|
<h2>
|
117
175
|
Instance Method Summary
|
118
176
|
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
@@ -204,24 +262,24 @@ Creates a new instance of Trackerific::Base with required options
|
|
204
262
|
<pre class="lines">
|
205
263
|
|
206
264
|
|
265
|
+
6
|
266
|
+
7
|
267
|
+
8
|
268
|
+
9
|
269
|
+
10
|
270
|
+
11
|
271
|
+
12
|
272
|
+
13
|
207
273
|
14
|
208
274
|
15
|
209
275
|
16
|
210
|
-
17
|
211
|
-
18
|
212
|
-
19
|
213
|
-
20
|
214
|
-
21
|
215
|
-
22
|
216
|
-
23
|
217
|
-
24
|
218
|
-
25</pre>
|
276
|
+
17</pre>
|
219
277
|
</td>
|
220
278
|
<td>
|
221
|
-
<pre class="code"><span class="info file"># File 'lib/trackerific.rb', line
|
279
|
+
<pre class="code"><span class="info file"># File 'lib/trackerific/base.rb', line 6</span>
|
222
280
|
|
223
281
|
<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>
|
224
|
-
<span class='id required'>required</span> <span class='op'>=</span> <span class='id required_options'>required_options</span>
|
282
|
+
<span class='id required'>required</span> <span class='op'>=</span> <span class='kw'>self</span><span class='period'>.</span><span class='id class'>class</span><span class='period'>.</span><span class='id required_options'>required_options</span>
|
225
283
|
<span class='comment'># make sure all the required options exist
|
226
284
|
</span> <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>
|
227
285
|
<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>
|
@@ -240,6 +298,164 @@ Creates a new instance of Trackerific::Base with required options
|
|
240
298
|
</div>
|
241
299
|
|
242
300
|
|
301
|
+
<div id="class_method_details" class="method_details_list">
|
302
|
+
<h2>Class Method Details</h2>
|
303
|
+
|
304
|
+
|
305
|
+
<div class="method_details first">
|
306
|
+
<p class="signature first" id="package_id_matchers-class_method">
|
307
|
+
|
308
|
+
+ (<tt>Array</tt>, <tt>Regexp</tt>) <strong>package_id_matchers</strong>
|
309
|
+
|
310
|
+
|
311
|
+
|
312
|
+
</p><div class="docstring">
|
313
|
+
<div class="discussion">
|
314
|
+
<p>
|
315
|
+
An Array of Regexp that matches valid package identifiers for your service
|
316
|
+
</p>
|
317
|
+
|
318
|
+
|
319
|
+
</div>
|
320
|
+
</div>
|
321
|
+
<div class="tags">
|
322
|
+
|
323
|
+
<div class="examples">
|
324
|
+
<h3>Examples:</h3>
|
325
|
+
|
326
|
+
<h4><div class='inline'><p>
|
327
|
+
Override this method in your custom tracking service
|
328
|
+
</p>
|
329
|
+
</div></h4>
|
330
|
+
<pre class="example code"><span class='kw'>module</span> <span class='const'>Trackerific</span>
|
331
|
+
<span class='kw'>class</span> <span class='const'>MyTrackingService</span> <span class='op'><</span> <span class='const'>Base</span>
|
332
|
+
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id package_id_matchers'>package_id_matchers</span>
|
333
|
+
<span class='lbracket'>[</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='rbracket'>]</span> <span class='comment'># matchers for UPS package identifiers
|
334
|
+
</span> <span class='kw'>end</span>
|
335
|
+
<span class='kw'>end</span>
|
336
|
+
<span class='kw'>end</span></pre>
|
337
|
+
|
338
|
+
</div>
|
339
|
+
<h3>Returns:</h3>
|
340
|
+
<ul class="return">
|
341
|
+
|
342
|
+
<li>
|
343
|
+
|
344
|
+
|
345
|
+
<span class='type'>(<tt>Array</tt>, <tt>Regexp</tt>)</span>
|
346
|
+
|
347
|
+
|
348
|
+
|
349
|
+
—
|
350
|
+
<div class='inline'><p>
|
351
|
+
an array of regular expressions
|
352
|
+
</p>
|
353
|
+
</div>
|
354
|
+
|
355
|
+
</li>
|
356
|
+
|
357
|
+
</ul>
|
358
|
+
|
359
|
+
</div><table class="source_code">
|
360
|
+
<tr>
|
361
|
+
<td>
|
362
|
+
<pre class="lines">
|
363
|
+
|
364
|
+
|
365
|
+
50
|
366
|
+
51
|
367
|
+
52</pre>
|
368
|
+
</td>
|
369
|
+
<td>
|
370
|
+
<pre class="code"><span class="info file"># File 'lib/trackerific/base.rb', line 50</span>
|
371
|
+
|
372
|
+
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id package_id_matchers'>package_id_matchers</span>
|
373
|
+
<span class='kw'>nil</span>
|
374
|
+
<span class='kw'>end</span></pre>
|
375
|
+
</td>
|
376
|
+
</tr>
|
377
|
+
</table>
|
378
|
+
</div>
|
379
|
+
|
380
|
+
<div class="method_details ">
|
381
|
+
<p class="signature " id="required_options-class_method">
|
382
|
+
|
383
|
+
+ (<tt>Array</tt>) <strong>required_options</strong>
|
384
|
+
|
385
|
+
|
386
|
+
|
387
|
+
</p><div class="docstring">
|
388
|
+
<div class="discussion">
|
389
|
+
<p>
|
390
|
+
An array of options that are required to create a new instance of this
|
391
|
+
class
|
392
|
+
</p>
|
393
|
+
|
394
|
+
|
395
|
+
</div>
|
396
|
+
</div>
|
397
|
+
<div class="tags">
|
398
|
+
|
399
|
+
<div class="examples">
|
400
|
+
<h3>Examples:</h3>
|
401
|
+
|
402
|
+
<h4><div class='inline'><p>
|
403
|
+
Override this method in your custom tracking service to enforce some
|
404
|
+
options
|
405
|
+
</p>
|
406
|
+
</div></h4>
|
407
|
+
<pre class="example code"><span class='kw'>module</span> <span class='const'>Trackerific</span>
|
408
|
+
<span class='kw'>class</span> <span class='const'>MyTrackingService</span> <span class='op'><</span> <span class='const'>Base</span>
|
409
|
+
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id required_options'>required_options</span>
|
410
|
+
<span class='lbracket'>[</span><span class='symbol'>:all</span><span class='comma'>,</span> <span class='symbol'>:these</span><span class='comma'>,</span> <span class='symbol'>:are</span><span class='comma'>,</span> <span class='symbol'>:required</span><span class='rbracket'>]</span>
|
411
|
+
<span class='kw'>end</span>
|
412
|
+
<span class='kw'>end</span>
|
413
|
+
<span class='kw'>end</span></pre>
|
414
|
+
|
415
|
+
</div>
|
416
|
+
<h3>Returns:</h3>
|
417
|
+
<ul class="return">
|
418
|
+
|
419
|
+
<li>
|
420
|
+
|
421
|
+
|
422
|
+
<span class='type'>(<tt>Array</tt>)</span>
|
423
|
+
|
424
|
+
|
425
|
+
|
426
|
+
—
|
427
|
+
<div class='inline'><p>
|
428
|
+
the required options
|
429
|
+
</p>
|
430
|
+
</div>
|
431
|
+
|
432
|
+
</li>
|
433
|
+
|
434
|
+
</ul>
|
435
|
+
|
436
|
+
</div><table class="source_code">
|
437
|
+
<tr>
|
438
|
+
<td>
|
439
|
+
<pre class="lines">
|
440
|
+
|
441
|
+
|
442
|
+
65
|
443
|
+
66
|
444
|
+
67</pre>
|
445
|
+
</td>
|
446
|
+
<td>
|
447
|
+
<pre class="code"><span class="info file"># File 'lib/trackerific/base.rb', line 65</span>
|
448
|
+
|
449
|
+
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id required_options'>required_options</span>
|
450
|
+
<span class='lbracket'>[</span><span class='rbracket'>]</span>
|
451
|
+
<span class='kw'>end</span></pre>
|
452
|
+
</td>
|
453
|
+
</tr>
|
454
|
+
</table>
|
455
|
+
</div>
|
456
|
+
|
457
|
+
</div>
|
458
|
+
|
243
459
|
<div id="instance_method_details" class="method_details_list">
|
244
460
|
<h2>Instance Method Details</h2>
|
245
461
|
|
@@ -266,13 +482,14 @@ Gets the tracking information for the package from the server
|
|
266
482
|
<h3>Examples:</h3>
|
267
483
|
|
268
484
|
<h4><div class='inline'><p>
|
269
|
-
Override this method in your custom tracking
|
485
|
+
Override this method in your custom tracking service to implement tracking
|
270
486
|
</p>
|
271
487
|
</div></h4>
|
272
488
|
<pre class="example code"><span class='kw'>module</span> <span class='const'>Trackerific</span>
|
273
|
-
<span class='kw'>class</span> <span class='const'>
|
489
|
+
<span class='kw'>class</span> <span class='const'>MyTrackingService</span> <span class='op'><</span> <span class='const'>Base</span>
|
274
490
|
<span class='kw'>def</span> <span class='id track_package'>track_package</span>
|
275
|
-
<span class='
|
491
|
+
<span class='comment'># your tracking code here
|
492
|
+
</span> <span class='const'>Trackerific</span><span class='op'>::</span><span class='const'>Details</span><span class='period'>.</span><span class='id new'>new</span><span class='lparen'>(</span>
|
276
493
|
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>summary of tracking events</span><span class='tstring_end'>"</span></span><span class='comma'>,</span>
|
277
494
|
<span class='lbracket'>[</span><span class='const'>Trackerific</span><span class='op'>::</span><span class='const'>Event</span><span class='period'>.</span><span class='id new'>new</span><span class='lparen'>(</span><span class='const'>Time</span><span class='period'>.</span><span class='id now'>now</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>summary</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>location</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span><span class='rbracket'>]</span>
|
278
495
|
<span class='rparen'>)</span>
|
@@ -328,12 +545,12 @@ the tracking details
|
|
328
545
|
<pre class="lines">
|
329
546
|
|
330
547
|
|
331
|
-
|
332
|
-
|
333
|
-
|
548
|
+
35
|
549
|
+
36
|
550
|
+
37</pre>
|
334
551
|
</td>
|
335
552
|
<td>
|
336
|
-
<pre class="code"><span class="info file"># File 'lib/trackerific.rb', line
|
553
|
+
<pre class="code"><span class="info file"># File 'lib/trackerific/base.rb', line 35</span>
|
337
554
|
|
338
555
|
<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>
|
339
556
|
<span class='ivar'>@package_id</span> <span class='op'>=</span> <span class='id package_id'>package_id</span>
|
@@ -348,7 +565,7 @@ the tracking details
|
|
348
565
|
</div>
|
349
566
|
|
350
567
|
<div id="footer">
|
351
|
-
Generated on Mon Jun 13
|
568
|
+
Generated on Mon Jun 13 21:28:36 2011 by
|
352
569
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
353
570
|
0.7.1 (ruby-1.9.2).
|
354
571
|
</div>
|