t2_airtime 0.2.0 → 0.2.1
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.
- checksums.yaml +4 -4
- data/.gitignore +0 -1
- data/README.md +13 -14
- data/app/controllers/t2_airtime/airtime_controller.rb +9 -4
- data/doc/T2Airtime/API.html +1152 -0
- data/doc/T2Airtime/Account.html +260 -0
- data/doc/T2Airtime/AirtimeController.html +491 -0
- data/doc/T2Airtime/Base.html +346 -0
- data/doc/T2Airtime/ConfigurationError.html +124 -0
- data/doc/T2Airtime/Country.html +448 -0
- data/doc/T2Airtime/Engine.html +124 -0
- data/doc/T2Airtime/Error.html +290 -0
- data/doc/T2Airtime/Operator.html +272 -0
- data/doc/T2Airtime/Product.html +294 -0
- data/doc/T2Airtime/Reply.html +775 -0
- data/doc/T2Airtime/Request.html +664 -0
- data/doc/T2Airtime/Test.html +221 -0
- data/doc/T2Airtime/Transaction.html +426 -0
- data/doc/T2Airtime/Util.html +338 -0
- data/doc/T2Airtime.html +147 -0
- data/doc/_index.html +265 -0
- data/doc/class_list.html +51 -0
- data/doc/css/common.css +1 -0
- data/doc/css/full_list.css +58 -0
- data/doc/css/style.css +492 -0
- data/doc/file.README.html +172 -0
- data/doc/file_list.html +56 -0
- data/doc/frames.html +17 -0
- data/doc/index.html +172 -0
- data/doc/js/app.js +248 -0
- data/doc/js/full_list.js +216 -0
- data/doc/js/jquery.js +4 -0
- data/doc/method_list.html +491 -0
- data/doc/top-level-namespace.html +110 -0
- data/lib/t2_airtime/serializer.rb +10 -5
- data/lib/t2_airtime/util.rb +4 -0
- data/lib/t2_airtime/version.rb +1 -1
- data/release +6 -0
- metadata +33 -2
@@ -0,0 +1,290 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<meta charset="utf-8">
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6
|
+
<title>
|
7
|
+
Exception: T2Airtime::Error
|
8
|
+
|
9
|
+
— Documentation by YARD 0.9.9
|
10
|
+
|
11
|
+
</title>
|
12
|
+
|
13
|
+
<link rel="stylesheet" href="../css/style.css" type="text/css" charset="utf-8" />
|
14
|
+
|
15
|
+
<link rel="stylesheet" href="../css/common.css" type="text/css" charset="utf-8" />
|
16
|
+
|
17
|
+
<script type="text/javascript" charset="utf-8">
|
18
|
+
pathId = "T2Airtime::Error";
|
19
|
+
relpath = '../';
|
20
|
+
</script>
|
21
|
+
|
22
|
+
|
23
|
+
<script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
|
24
|
+
|
25
|
+
<script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
|
26
|
+
|
27
|
+
|
28
|
+
</head>
|
29
|
+
<body>
|
30
|
+
<div class="nav_wrap">
|
31
|
+
<iframe id="nav" src="../class_list.html?1"></iframe>
|
32
|
+
<div id="resizer"></div>
|
33
|
+
</div>
|
34
|
+
|
35
|
+
<div id="main" tabindex="-1">
|
36
|
+
<div id="header">
|
37
|
+
<div id="menu">
|
38
|
+
|
39
|
+
<a href="../_index.html">Index (E)</a> »
|
40
|
+
<span class='title'><span class='object_link'><a href="../T2Airtime.html" title="T2Airtime (module)">T2Airtime</a></span></span>
|
41
|
+
»
|
42
|
+
<span class="title">Error</span>
|
43
|
+
|
44
|
+
</div>
|
45
|
+
|
46
|
+
<div id="search">
|
47
|
+
|
48
|
+
<a class="full_list_link" id="class_list_link"
|
49
|
+
href="../class_list.html">
|
50
|
+
|
51
|
+
<svg width="24" height="24">
|
52
|
+
<rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
|
53
|
+
<rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
|
54
|
+
<rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
|
55
|
+
</svg>
|
56
|
+
</a>
|
57
|
+
|
58
|
+
</div>
|
59
|
+
<div class="clear"></div>
|
60
|
+
</div>
|
61
|
+
|
62
|
+
<div id="content"><h1>Exception: T2Airtime::Error
|
63
|
+
|
64
|
+
|
65
|
+
|
66
|
+
</h1>
|
67
|
+
<div class="box_info">
|
68
|
+
|
69
|
+
<dl>
|
70
|
+
<dt>Inherits:</dt>
|
71
|
+
<dd>
|
72
|
+
<span class="inheritName">StandardError</span>
|
73
|
+
|
74
|
+
<ul class="fullTree">
|
75
|
+
<li>Object</li>
|
76
|
+
|
77
|
+
<li class="next">StandardError</li>
|
78
|
+
|
79
|
+
<li class="next">T2Airtime::Error</li>
|
80
|
+
|
81
|
+
</ul>
|
82
|
+
<a href="#" class="inheritanceTree">show all</a>
|
83
|
+
|
84
|
+
</dd>
|
85
|
+
</dl>
|
86
|
+
|
87
|
+
|
88
|
+
|
89
|
+
|
90
|
+
|
91
|
+
|
92
|
+
|
93
|
+
|
94
|
+
|
95
|
+
|
96
|
+
|
97
|
+
<dl>
|
98
|
+
<dt>Defined in:</dt>
|
99
|
+
<dd>lib/t2_airtime/errors.rb</dd>
|
100
|
+
</dl>
|
101
|
+
|
102
|
+
</div>
|
103
|
+
|
104
|
+
|
105
|
+
|
106
|
+
|
107
|
+
|
108
|
+
<h2>Instance Attribute Summary <small><a href="#" class="summary_toggle">collapse</a></small></h2>
|
109
|
+
<ul class="summary">
|
110
|
+
|
111
|
+
<li class="public ">
|
112
|
+
<span class="summary_signature">
|
113
|
+
|
114
|
+
<a href="#code-instance_method" title="#code (instance method)">#<strong>code</strong> ⇒ Object </a>
|
115
|
+
|
116
|
+
|
117
|
+
|
118
|
+
</span>
|
119
|
+
|
120
|
+
|
121
|
+
|
122
|
+
|
123
|
+
<span class="note title readonly">readonly</span>
|
124
|
+
|
125
|
+
|
126
|
+
|
127
|
+
|
128
|
+
|
129
|
+
|
130
|
+
|
131
|
+
|
132
|
+
|
133
|
+
<span class="summary_desc"><div class='inline'>
|
134
|
+
<p>Returns the value of attribute code.</p>
|
135
|
+
</div></span>
|
136
|
+
|
137
|
+
</li>
|
138
|
+
|
139
|
+
|
140
|
+
</ul>
|
141
|
+
|
142
|
+
|
143
|
+
|
144
|
+
|
145
|
+
|
146
|
+
<h2>
|
147
|
+
Instance Method Summary
|
148
|
+
<small><a href="#" class="summary_toggle">collapse</a></small>
|
149
|
+
</h2>
|
150
|
+
|
151
|
+
<ul class="summary">
|
152
|
+
|
153
|
+
<li class="public ">
|
154
|
+
<span class="summary_signature">
|
155
|
+
|
156
|
+
<a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(code, message = nil) ⇒ Error </a>
|
157
|
+
|
158
|
+
|
159
|
+
|
160
|
+
</span>
|
161
|
+
|
162
|
+
|
163
|
+
<span class="note title constructor">constructor</span>
|
164
|
+
|
165
|
+
|
166
|
+
|
167
|
+
|
168
|
+
|
169
|
+
|
170
|
+
|
171
|
+
|
172
|
+
<span class="summary_desc"><div class='inline'>
|
173
|
+
<p>A new instance of Error.</p>
|
174
|
+
</div></span>
|
175
|
+
|
176
|
+
</li>
|
177
|
+
|
178
|
+
|
179
|
+
</ul>
|
180
|
+
|
181
|
+
|
182
|
+
|
183
|
+
<div id="constructor_details" class="method_details_list">
|
184
|
+
<h2>Constructor Details</h2>
|
185
|
+
|
186
|
+
<div class="method_details first">
|
187
|
+
<h3 class="signature first" id="initialize-instance_method">
|
188
|
+
|
189
|
+
#<strong>initialize</strong>(code, message = nil) ⇒ <tt><span class='object_link'><a href="" title="T2Airtime::Error (class)">Error</a></span></tt>
|
190
|
+
|
191
|
+
|
192
|
+
|
193
|
+
|
194
|
+
|
195
|
+
</h3><div class="docstring">
|
196
|
+
<div class="discussion">
|
197
|
+
|
198
|
+
<p>Returns a new instance of Error</p>
|
199
|
+
|
200
|
+
|
201
|
+
</div>
|
202
|
+
</div>
|
203
|
+
<div class="tags">
|
204
|
+
|
205
|
+
|
206
|
+
</div><table class="source_code">
|
207
|
+
<tr>
|
208
|
+
<td>
|
209
|
+
<pre class="lines">
|
210
|
+
|
211
|
+
|
212
|
+
80
|
213
|
+
81
|
214
|
+
82
|
215
|
+
83</pre>
|
216
|
+
</td>
|
217
|
+
<td>
|
218
|
+
<pre class="code"><span class="info file"># File 'lib/t2_airtime/errors.rb', line 80</span>
|
219
|
+
|
220
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_code'>code</span><span class='comma'>,</span> <span class='id identifier rubyid_message'>message</span><span class='op'>=</span><span class='kw'>nil</span><span class='rparen'>)</span>
|
221
|
+
<span class='ivar'>@code</span> <span class='op'>=</span> <span class='id identifier rubyid_code'>code</span><span class='period'>.</span><span class='id identifier rubyid_to_i'>to_i</span>
|
222
|
+
<span class='kw'>super</span><span class='lparen'>(</span><span class='id identifier rubyid_message'>message</span><span class='rparen'>)</span>
|
223
|
+
<span class='kw'>end</span></pre>
|
224
|
+
</td>
|
225
|
+
</tr>
|
226
|
+
</table>
|
227
|
+
</div>
|
228
|
+
|
229
|
+
</div>
|
230
|
+
|
231
|
+
<div id="instance_attr_details" class="attr_details">
|
232
|
+
<h2>Instance Attribute Details</h2>
|
233
|
+
|
234
|
+
|
235
|
+
<span id=""></span>
|
236
|
+
<div class="method_details first">
|
237
|
+
<h3 class="signature first" id="code-instance_method">
|
238
|
+
|
239
|
+
#<strong>code</strong> ⇒ <tt>Object</tt> <span class="extras">(readonly)</span>
|
240
|
+
|
241
|
+
|
242
|
+
|
243
|
+
|
244
|
+
|
245
|
+
</h3><div class="docstring">
|
246
|
+
<div class="discussion">
|
247
|
+
|
248
|
+
<p>Returns the value of attribute code</p>
|
249
|
+
|
250
|
+
|
251
|
+
</div>
|
252
|
+
</div>
|
253
|
+
<div class="tags">
|
254
|
+
|
255
|
+
|
256
|
+
</div><table class="source_code">
|
257
|
+
<tr>
|
258
|
+
<td>
|
259
|
+
<pre class="lines">
|
260
|
+
|
261
|
+
|
262
|
+
78
|
263
|
+
79
|
264
|
+
80</pre>
|
265
|
+
</td>
|
266
|
+
<td>
|
267
|
+
<pre class="code"><span class="info file"># File 'lib/t2_airtime/errors.rb', line 78</span>
|
268
|
+
|
269
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_code'>code</span>
|
270
|
+
<span class='ivar'>@code</span>
|
271
|
+
<span class='kw'>end</span></pre>
|
272
|
+
</td>
|
273
|
+
</tr>
|
274
|
+
</table>
|
275
|
+
</div>
|
276
|
+
|
277
|
+
</div>
|
278
|
+
|
279
|
+
|
280
|
+
</div>
|
281
|
+
|
282
|
+
<div id="footer">
|
283
|
+
Generated on Sun Aug 27 17:54:43 2017 by
|
284
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
285
|
+
0.9.9 (ruby-2.3.3).
|
286
|
+
</div>
|
287
|
+
|
288
|
+
</div>
|
289
|
+
</body>
|
290
|
+
</html>
|
@@ -0,0 +1,272 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<meta charset="utf-8">
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6
|
+
<title>
|
7
|
+
Class: T2Airtime::Operator
|
8
|
+
|
9
|
+
— Documentation by YARD 0.9.9
|
10
|
+
|
11
|
+
</title>
|
12
|
+
|
13
|
+
<link rel="stylesheet" href="../css/style.css" type="text/css" charset="utf-8" />
|
14
|
+
|
15
|
+
<link rel="stylesheet" href="../css/common.css" type="text/css" charset="utf-8" />
|
16
|
+
|
17
|
+
<script type="text/javascript" charset="utf-8">
|
18
|
+
pathId = "T2Airtime::Operator";
|
19
|
+
relpath = '../';
|
20
|
+
</script>
|
21
|
+
|
22
|
+
|
23
|
+
<script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
|
24
|
+
|
25
|
+
<script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
|
26
|
+
|
27
|
+
|
28
|
+
</head>
|
29
|
+
<body>
|
30
|
+
<div class="nav_wrap">
|
31
|
+
<iframe id="nav" src="../class_list.html?1"></iframe>
|
32
|
+
<div id="resizer"></div>
|
33
|
+
</div>
|
34
|
+
|
35
|
+
<div id="main" tabindex="-1">
|
36
|
+
<div id="header">
|
37
|
+
<div id="menu">
|
38
|
+
|
39
|
+
<a href="../_index.html">Index (O)</a> »
|
40
|
+
<span class='title'><span class='object_link'><a href="../T2Airtime.html" title="T2Airtime (module)">T2Airtime</a></span></span>
|
41
|
+
»
|
42
|
+
<span class="title">Operator</span>
|
43
|
+
|
44
|
+
</div>
|
45
|
+
|
46
|
+
<div id="search">
|
47
|
+
|
48
|
+
<a class="full_list_link" id="class_list_link"
|
49
|
+
href="../class_list.html">
|
50
|
+
|
51
|
+
<svg width="24" height="24">
|
52
|
+
<rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
|
53
|
+
<rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
|
54
|
+
<rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
|
55
|
+
</svg>
|
56
|
+
</a>
|
57
|
+
|
58
|
+
</div>
|
59
|
+
<div class="clear"></div>
|
60
|
+
</div>
|
61
|
+
|
62
|
+
<div id="content"><h1>Class: T2Airtime::Operator
|
63
|
+
|
64
|
+
|
65
|
+
|
66
|
+
</h1>
|
67
|
+
<div class="box_info">
|
68
|
+
|
69
|
+
<dl>
|
70
|
+
<dt>Inherits:</dt>
|
71
|
+
<dd>
|
72
|
+
<span class="inheritName">Object</span>
|
73
|
+
|
74
|
+
<ul class="fullTree">
|
75
|
+
<li>Object</li>
|
76
|
+
|
77
|
+
<li class="next">T2Airtime::Operator</li>
|
78
|
+
|
79
|
+
</ul>
|
80
|
+
<a href="#" class="inheritanceTree">show all</a>
|
81
|
+
|
82
|
+
</dd>
|
83
|
+
</dl>
|
84
|
+
|
85
|
+
|
86
|
+
|
87
|
+
|
88
|
+
|
89
|
+
|
90
|
+
|
91
|
+
|
92
|
+
|
93
|
+
|
94
|
+
|
95
|
+
<dl>
|
96
|
+
<dt>Defined in:</dt>
|
97
|
+
<dd>lib/t2_airtime/serializer.rb</dd>
|
98
|
+
</dl>
|
99
|
+
|
100
|
+
</div>
|
101
|
+
|
102
|
+
|
103
|
+
|
104
|
+
|
105
|
+
|
106
|
+
|
107
|
+
|
108
|
+
|
109
|
+
|
110
|
+
<h2>
|
111
|
+
Class Method Summary
|
112
|
+
<small><a href="#" class="summary_toggle">collapse</a></small>
|
113
|
+
</h2>
|
114
|
+
|
115
|
+
<ul class="summary">
|
116
|
+
|
117
|
+
<li class="public ">
|
118
|
+
<span class="summary_signature">
|
119
|
+
|
120
|
+
<a href="#serialize-class_method" title="serialize (class method)">.<strong>serialize</strong>(data, qty = nil) ⇒ Object </a>
|
121
|
+
|
122
|
+
|
123
|
+
|
124
|
+
</span>
|
125
|
+
|
126
|
+
|
127
|
+
|
128
|
+
|
129
|
+
|
130
|
+
|
131
|
+
|
132
|
+
|
133
|
+
|
134
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
135
|
+
|
136
|
+
</li>
|
137
|
+
|
138
|
+
|
139
|
+
<li class="public ">
|
140
|
+
<span class="summary_signature">
|
141
|
+
|
142
|
+
<a href="#take-class_method" title="take (class method)">.<strong>take</strong>(country_qty = 1, qty = 5) ⇒ Object </a>
|
143
|
+
|
144
|
+
|
145
|
+
|
146
|
+
</span>
|
147
|
+
|
148
|
+
|
149
|
+
|
150
|
+
|
151
|
+
|
152
|
+
|
153
|
+
|
154
|
+
|
155
|
+
|
156
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
157
|
+
|
158
|
+
</li>
|
159
|
+
|
160
|
+
|
161
|
+
</ul>
|
162
|
+
|
163
|
+
|
164
|
+
|
165
|
+
|
166
|
+
<div id="class_method_details" class="method_details_list">
|
167
|
+
<h2>Class Method Details</h2>
|
168
|
+
|
169
|
+
|
170
|
+
<div class="method_details first">
|
171
|
+
<h3 class="signature first" id="serialize-class_method">
|
172
|
+
|
173
|
+
.<strong>serialize</strong>(data, qty = nil) ⇒ <tt>Object</tt>
|
174
|
+
|
175
|
+
|
176
|
+
|
177
|
+
|
178
|
+
|
179
|
+
</h3><table class="source_code">
|
180
|
+
<tr>
|
181
|
+
<td>
|
182
|
+
<pre class="lines">
|
183
|
+
|
184
|
+
|
185
|
+
85
|
186
|
+
86
|
187
|
+
87
|
188
|
+
88
|
189
|
+
89
|
190
|
+
90
|
191
|
+
91
|
192
|
+
92
|
193
|
+
93
|
194
|
+
94
|
195
|
+
95
|
196
|
+
96</pre>
|
197
|
+
</td>
|
198
|
+
<td>
|
199
|
+
<pre class="code"><span class="info file"># File 'lib/t2_airtime/serializer.rb', line 85</span>
|
200
|
+
|
201
|
+
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_serialize'>serialize</span><span class='lparen'>(</span><span class='id identifier rubyid_data'>data</span><span class='comma'>,</span> <span class='id identifier rubyid_qty'>qty</span><span class='op'>=</span><span class='kw'>nil</span><span class='rparen'>)</span>
|
202
|
+
<span class='id identifier rubyid_names'>names</span> <span class='op'>=</span> <span class='id identifier rubyid_data'>data</span><span class='lbracket'>[</span><span class='symbol'>:operator</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_split'>split</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>,</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
203
|
+
<span class='id identifier rubyid_ids'>ids</span> <span class='op'>=</span> <span class='id identifier rubyid_data'>data</span><span class='lbracket'>[</span><span class='symbol'>:operatorid</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_split'>split</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>,</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
204
|
+
<span class='id identifier rubyid_ids'>ids</span><span class='period'>.</span><span class='id identifier rubyid_take'>take</span><span class='lparen'>(</span><span class='id identifier rubyid_qty'>qty</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span> <span class='op'>?</span> <span class='id identifier rubyid_ids'>ids</span><span class='period'>.</span><span class='id identifier rubyid_count'>count</span> <span class='op'>:</span> <span class='id identifier rubyid_qty'>qty</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_each_with_index'>each_with_index</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span><span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_id'>id</span><span class='comma'>,</span> <span class='id identifier rubyid_n'>n</span><span class='op'>|</span> <span class='lbrace'>{</span>
|
205
|
+
<span class='label'>country:</span> <span class='id identifier rubyid_data'>data</span><span class='lbracket'>[</span><span class='symbol'>:country</span><span class='rbracket'>]</span><span class='comma'>,</span>
|
206
|
+
<span class='label'>country_aid:</span> <span class='const'>Integer</span><span class='lparen'>(</span><span class='id identifier rubyid_data'>data</span><span class='lbracket'>[</span><span class='symbol'>:countryid</span><span class='rbracket'>]</span><span class='rparen'>)</span><span class='comma'>,</span>
|
207
|
+
<span class='label'>alpha3:</span> <span class='const'><span class='object_link'><a href="../T2Airtime.html" title="T2Airtime (module)">T2Airtime</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Country.html" title="T2Airtime::Country (class)">Country</a></span></span><span class='period'>.</span><span class='id identifier rubyid_alpha3'><span class='object_link'><a href="Country.html#alpha3-class_method" title="T2Airtime::Country.alpha3 (method)">alpha3</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_data'>data</span><span class='lbracket'>[</span><span class='symbol'>:country</span><span class='rbracket'>]</span><span class='rparen'>)</span><span class='comma'>,</span>
|
208
|
+
<span class='label'>name:</span> <span class='id identifier rubyid_names'>names</span><span class='lbracket'>[</span><span class='id identifier rubyid_n'>n</span><span class='rbracket'>]</span><span class='comma'>,</span>
|
209
|
+
<span class='label'>logo_url:</span> <span class='const'><span class='object_link'><a href="../T2Airtime.html" title="T2Airtime (module)">T2Airtime</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Util.html" title="T2Airtime::Util (class)">Util</a></span></span><span class='period'>.</span><span class='id identifier rubyid_operator_logo_url'><span class='object_link'><a href="Util.html#operator_logo_url-class_method" title="T2Airtime::Util.operator_logo_url (method)">operator_logo_url</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_id'>id</span><span class='rparen'>)</span><span class='comma'>,</span>
|
210
|
+
<span class='label'>aid:</span> <span class='const'>Integer</span><span class='lparen'>(</span><span class='id identifier rubyid_id'>id</span><span class='rparen'>)</span>
|
211
|
+
<span class='rbrace'>}</span><span class='rbrace'>}</span>
|
212
|
+
<span class='kw'>end</span></pre>
|
213
|
+
</td>
|
214
|
+
</tr>
|
215
|
+
</table>
|
216
|
+
</div>
|
217
|
+
|
218
|
+
<div class="method_details ">
|
219
|
+
<h3 class="signature " id="take-class_method">
|
220
|
+
|
221
|
+
.<strong>take</strong>(country_qty = 1, qty = 5) ⇒ <tt>Object</tt>
|
222
|
+
|
223
|
+
|
224
|
+
|
225
|
+
|
226
|
+
|
227
|
+
</h3><table class="source_code">
|
228
|
+
<tr>
|
229
|
+
<td>
|
230
|
+
<pre class="lines">
|
231
|
+
|
232
|
+
|
233
|
+
75
|
234
|
+
76
|
235
|
+
77
|
236
|
+
78
|
237
|
+
79
|
238
|
+
80
|
239
|
+
81
|
240
|
+
82
|
241
|
+
83</pre>
|
242
|
+
</td>
|
243
|
+
<td>
|
244
|
+
<pre class="code"><span class="info file"># File 'lib/t2_airtime/serializer.rb', line 75</span>
|
245
|
+
|
246
|
+
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_take'>take</span><span class='lparen'>(</span><span class='id identifier rubyid_country_qty'>country_qty</span><span class='op'>=</span><span class='int'>1</span><span class='comma'>,</span> <span class='id identifier rubyid_qty'>qty</span><span class='op'>=</span><span class='int'>5</span><span class='rparen'>)</span>
|
247
|
+
<span class='id identifier rubyid_countries'>countries</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="../T2Airtime.html" title="T2Airtime (module)">T2Airtime</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Country.html" title="T2Airtime::Country (class)">Country</a></span></span><span class='period'>.</span><span class='id identifier rubyid_take'><span class='object_link'><a href="Country.html#take-class_method" title="T2Airtime::Country.take (method)">take</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_country_qty'>country_qty</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_shuffle'>shuffle</span>
|
248
|
+
<span class='kw'>unless</span> <span class='id identifier rubyid_countries'>countries</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span>
|
249
|
+
<span class='id identifier rubyid_countries'>countries</span><span class='period'>.</span><span class='id identifier rubyid_flat_map'>flat_map</span><span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_country'>country</span><span class='op'>|</span> <span class='lparen'>(</span>
|
250
|
+
<span class='id identifier rubyid_reply'>reply</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="../T2Airtime.html" title="T2Airtime (module)">T2Airtime</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="API.html" title="T2Airtime::API (class)">API</a></span></span><span class='period'>.</span><span class='id identifier rubyid_api'><span class='object_link'><a href="Base.html#api-class_method" title="T2Airtime::Base.api (method)">api</a></span></span><span class='period'>.</span><span class='id identifier rubyid_operator_list'>operator_list</span><span class='lparen'>(</span><span class='id identifier rubyid_country'>country</span><span class='lbracket'>[</span><span class='symbol'>:aid</span><span class='rbracket'>]</span><span class='rparen'>)</span>
|
251
|
+
<span class='id identifier rubyid_reply'>reply</span><span class='period'>.</span><span class='id identifier rubyid_success?'>success?</span> <span class='op'>?</span> <span class='id identifier rubyid_serialize'>serialize</span><span class='lparen'>(</span><span class='id identifier rubyid_reply'>reply</span><span class='period'>.</span><span class='id identifier rubyid_data'>data</span><span class='comma'>,</span> <span class='id identifier rubyid_qty'>qty</span><span class='rparen'>)</span> <span class='op'>:</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
|
252
|
+
<span class='rparen'>)</span><span class='rbrace'>}</span>
|
253
|
+
<span class='kw'>end</span>
|
254
|
+
<span class='kw'>end</span></pre>
|
255
|
+
</td>
|
256
|
+
</tr>
|
257
|
+
</table>
|
258
|
+
</div>
|
259
|
+
|
260
|
+
</div>
|
261
|
+
|
262
|
+
</div>
|
263
|
+
|
264
|
+
<div id="footer">
|
265
|
+
Generated on Sun Aug 27 17:54:44 2017 by
|
266
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
267
|
+
0.9.9 (ruby-2.3.3).
|
268
|
+
</div>
|
269
|
+
|
270
|
+
</div>
|
271
|
+
</body>
|
272
|
+
</html>
|