maxcube-client 0.4.1 → 0.5.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.
- checksums.yaml +4 -4
- data/.gitignore +6 -0
- data/.rubocop.yml +0 -3
- data/.yardopts +1 -0
- data/README.md +17 -2
- data/bin/maxcube-client +2 -27
- data/doc/MaxCube.html +502 -0
- data/doc/MaxCube/Messages.html +1927 -0
- data/doc/MaxCube/Messages/Handler.html +2912 -0
- data/doc/MaxCube/Messages/InvalidMessage.html +140 -0
- data/doc/MaxCube/Messages/InvalidMessageBody.html +264 -0
- data/doc/MaxCube/Messages/InvalidMessageFormat.html +247 -0
- data/doc/MaxCube/Messages/InvalidMessageLength.html +247 -0
- data/doc/MaxCube/Messages/InvalidMessageType.html +263 -0
- data/doc/MaxCube/Messages/Parser.html +520 -0
- data/doc/MaxCube/Messages/Serializer.html +701 -0
- data/doc/MaxCube/Messages/TCP.html +172 -0
- data/doc/MaxCube/Messages/TCP/Handler.html +1396 -0
- data/doc/MaxCube/Messages/TCP/Parser.html +462 -0
- data/doc/MaxCube/Messages/TCP/Parser/MessageA.html +186 -0
- data/doc/MaxCube/Messages/TCP/Parser/MessageC.html +1077 -0
- data/doc/MaxCube/Messages/TCP/Parser/MessageF.html +206 -0
- data/doc/MaxCube/Messages/TCP/Parser/MessageH.html +338 -0
- data/doc/MaxCube/Messages/TCP/Parser/MessageL.html +535 -0
- data/doc/MaxCube/Messages/TCP/Parser/MessageM.html +510 -0
- data/doc/MaxCube/Messages/TCP/Parser/MessageN.html +226 -0
- data/doc/MaxCube/Messages/TCP/Parser/MessageS.html +225 -0
- data/doc/MaxCube/Messages/TCP/Serializer.html +460 -0
- data/doc/MaxCube/Messages/TCP/Serializer/MessageA.html +186 -0
- data/doc/MaxCube/Messages/TCP/Serializer/MessageC.html +185 -0
- data/doc/MaxCube/Messages/TCP/Serializer/MessageF.html +206 -0
- data/doc/MaxCube/Messages/TCP/Serializer/MessageL.html +185 -0
- data/doc/MaxCube/Messages/TCP/Serializer/MessageM.html +428 -0
- data/doc/MaxCube/Messages/TCP/Serializer/MessageN.html +209 -0
- data/doc/MaxCube/Messages/TCP/Serializer/MessageQ.html +185 -0
- data/doc/MaxCube/Messages/TCP/Serializer/MessageS.html +1168 -0
- data/doc/MaxCube/Messages/TCP/Serializer/MessageT.html +240 -0
- data/doc/MaxCube/Messages/TCP/Serializer/MessageU.html +206 -0
- data/doc/MaxCube/Messages/TCP/Serializer/MessageZ.html +252 -0
- data/doc/MaxCube/Messages/UDP.html +164 -0
- data/doc/MaxCube/Messages/UDP/Handler.html +832 -0
- data/doc/MaxCube/Messages/UDP/Parser.html +609 -0
- data/doc/MaxCube/Messages/UDP/Parser/MessageH.html +218 -0
- data/doc/MaxCube/Messages/UDP/Parser/MessageI.html +215 -0
- data/doc/MaxCube/Messages/UDP/Parser/MessageN.html +226 -0
- data/doc/MaxCube/Messages/UDP/Serializer.html +484 -0
- data/doc/MaxCube/Network.html +167 -0
- data/doc/MaxCube/Network/TCP.html +150 -0
- data/doc/MaxCube/Network/TCP/Client.html +1930 -0
- data/doc/MaxCube/Network/TCP/Client/Commands.html +2457 -0
- data/doc/MaxCube/Network/TCP/SampleServer.html +910 -0
- data/doc/MaxCube/Network/UDP.html +150 -0
- data/doc/MaxCube/Network/UDP/Client.html +518 -0
- data/doc/MaxCube/Network/UDP/SampleSocket.html +628 -0
- data/doc/MaxCube/Runner.html +355 -0
- data/doc/_index.html +518 -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 +499 -0
- data/doc/file.README.html +140 -0
- data/doc/file_list.html +56 -0
- data/doc/frames.html +17 -0
- data/doc/index.html +140 -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 +1699 -0
- data/doc/top-level-namespace.html +110 -0
- data/lib/maxcube.rb +11 -0
- data/lib/maxcube/messages.rb +85 -8
- data/lib/maxcube/messages/handler.rb +138 -4
- data/lib/maxcube/messages/parser.rb +33 -2
- data/lib/maxcube/messages/serializer.rb +64 -16
- data/lib/maxcube/messages/tcp.rb +11 -7
- data/lib/maxcube/messages/tcp/handler.rb +50 -2
- data/lib/maxcube/messages/tcp/parser.rb +18 -17
- data/lib/maxcube/messages/tcp/serializer.rb +20 -21
- data/lib/maxcube/messages/tcp/type/a.rb +6 -6
- data/lib/maxcube/messages/tcp/type/c.rb +5 -3
- data/lib/maxcube/messages/tcp/type/f.rb +5 -3
- data/lib/maxcube/messages/tcp/type/h.rb +3 -2
- data/lib/maxcube/messages/tcp/type/l.rb +8 -7
- data/lib/maxcube/messages/tcp/type/m.rb +11 -7
- data/lib/maxcube/messages/tcp/type/n.rb +5 -3
- data/lib/maxcube/messages/tcp/type/q.rb +2 -2
- data/lib/maxcube/messages/tcp/type/s.rb +5 -2
- data/lib/maxcube/messages/tcp/type/t.rb +5 -4
- data/lib/maxcube/messages/tcp/type/u.rb +2 -1
- data/lib/maxcube/messages/tcp/type/z.rb +4 -2
- data/lib/maxcube/messages/udp.rb +7 -0
- data/lib/maxcube/messages/udp/handler.rb +28 -0
- data/lib/maxcube/messages/udp/parser.rb +23 -6
- data/lib/maxcube/messages/udp/serializer.rb +17 -1
- data/lib/maxcube/messages/udp/type/h.rb +2 -0
- data/lib/maxcube/messages/udp/type/i.rb +3 -0
- data/lib/maxcube/messages/udp/type/n.rb +3 -0
- data/lib/maxcube/network.rb +5 -1
- data/lib/maxcube/network/tcp.rb +3 -0
- data/lib/maxcube/network/tcp/client.rb +117 -3
- data/lib/maxcube/network/tcp/client/commands.rb +306 -239
- data/lib/maxcube/network/tcp/sample_server.rb +1 -0
- data/lib/maxcube/network/udp.rb +3 -0
- data/lib/maxcube/network/udp/client.rb +2 -0
- data/lib/maxcube/network/udp/sample_socket.rb +1 -0
- data/lib/maxcube/runner.rb +45 -0
- data/lib/maxcube/version.rb +2 -1
- data/maxcube-client.gemspec +2 -0
- metadata +84 -3
@@ -0,0 +1,1927 @@
|
|
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
|
+
Module: MaxCube::Messages
|
8
|
+
|
9
|
+
— Documentation by YARD 0.9.12
|
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 = "MaxCube::Messages";
|
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 (M)</a> »
|
40
|
+
<span class='title'><span class='object_link'><a href="../MaxCube.html" title="MaxCube (module)">MaxCube</a></span></span>
|
41
|
+
»
|
42
|
+
<span class="title">Messages</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>Module: MaxCube::Messages
|
63
|
+
|
64
|
+
|
65
|
+
|
66
|
+
</h1>
|
67
|
+
<div class="box_info">
|
68
|
+
|
69
|
+
|
70
|
+
|
71
|
+
|
72
|
+
|
73
|
+
|
74
|
+
|
75
|
+
|
76
|
+
|
77
|
+
<dl>
|
78
|
+
<dt>Included in:</dt>
|
79
|
+
<dd><span class='object_link'><a href="Messages/Handler.html" title="MaxCube::Messages::Handler (module)">Handler</a></span></dd>
|
80
|
+
</dl>
|
81
|
+
|
82
|
+
|
83
|
+
|
84
|
+
<dl>
|
85
|
+
<dt>Defined in:</dt>
|
86
|
+
<dd>lib/maxcube/messages.rb<span class="defines">,<br />
|
87
|
+
lib/maxcube/messages/tcp.rb,<br /> lib/maxcube/messages/udp.rb,<br /> lib/maxcube/messages/parser.rb,<br /> lib/maxcube/messages/handler.rb,<br /> lib/maxcube/messages/serializer.rb,<br /> lib/maxcube/messages/tcp/parser.rb,<br /> lib/maxcube/messages/tcp/type/a.rb,<br /> lib/maxcube/messages/tcp/type/c.rb,<br /> lib/maxcube/messages/tcp/type/f.rb,<br /> lib/maxcube/messages/tcp/type/h.rb,<br /> lib/maxcube/messages/tcp/type/l.rb,<br /> lib/maxcube/messages/tcp/type/m.rb,<br /> lib/maxcube/messages/tcp/type/n.rb,<br /> lib/maxcube/messages/tcp/type/q.rb,<br /> lib/maxcube/messages/tcp/type/s.rb,<br /> lib/maxcube/messages/tcp/type/t.rb,<br /> lib/maxcube/messages/tcp/type/u.rb,<br /> lib/maxcube/messages/tcp/type/z.rb,<br /> lib/maxcube/messages/udp/parser.rb,<br /> lib/maxcube/messages/udp/type/h.rb,<br /> lib/maxcube/messages/udp/type/i.rb,<br /> lib/maxcube/messages/udp/type/n.rb,<br /> lib/maxcube/messages/tcp/handler.rb,<br /> lib/maxcube/messages/udp/handler.rb,<br /> lib/maxcube/messages/tcp/serializer.rb,<br /> lib/maxcube/messages/udp/serializer.rb</span>
|
88
|
+
</dd>
|
89
|
+
</dl>
|
90
|
+
|
91
|
+
</div>
|
92
|
+
|
93
|
+
<h2>Overview</h2><div class="docstring">
|
94
|
+
<div class="discussion">
|
95
|
+
|
96
|
+
<p>Encapsulates methods related to Cube messages, i.e. parsing and serializing
|
97
|
+
of TCP/UDP messages. It does not provide any network features (this is
|
98
|
+
responsibility of <span class='object_link'><a href="Network.html" title="MaxCube::Network (module)">Network</a></span>.</p>
|
99
|
+
|
100
|
+
|
101
|
+
</div>
|
102
|
+
</div>
|
103
|
+
<div class="tags">
|
104
|
+
|
105
|
+
|
106
|
+
</div><h2>Defined Under Namespace</h2>
|
107
|
+
<p class="children">
|
108
|
+
|
109
|
+
|
110
|
+
<strong class="modules">Modules:</strong> <span class='object_link'><a href="Messages/Handler.html" title="MaxCube::Messages::Handler (module)">Handler</a></span>, <span class='object_link'><a href="Messages/Parser.html" title="MaxCube::Messages::Parser (module)">Parser</a></span>, <span class='object_link'><a href="Messages/Serializer.html" title="MaxCube::Messages::Serializer (module)">Serializer</a></span>, <span class='object_link'><a href="Messages/TCP.html" title="MaxCube::Messages::TCP (module)">TCP</a></span>, <span class='object_link'><a href="Messages/UDP.html" title="MaxCube::Messages::UDP (module)">UDP</a></span>
|
111
|
+
|
112
|
+
|
113
|
+
|
114
|
+
<strong class="classes">Classes:</strong> <span class='object_link'><a href="Messages/InvalidMessage.html" title="MaxCube::Messages::InvalidMessage (class)">InvalidMessage</a></span>, <span class='object_link'><a href="Messages/InvalidMessageBody.html" title="MaxCube::Messages::InvalidMessageBody (class)">InvalidMessageBody</a></span>, <span class='object_link'><a href="Messages/InvalidMessageFormat.html" title="MaxCube::Messages::InvalidMessageFormat (class)">InvalidMessageFormat</a></span>, <span class='object_link'><a href="Messages/InvalidMessageLength.html" title="MaxCube::Messages::InvalidMessageLength (class)">InvalidMessageLength</a></span>, <span class='object_link'><a href="Messages/InvalidMessageType.html" title="MaxCube::Messages::InvalidMessageType (class)">InvalidMessageType</a></span>
|
115
|
+
|
116
|
+
|
117
|
+
</p>
|
118
|
+
|
119
|
+
<h2>Constant Summary</h2>
|
120
|
+
<dl class="constants">
|
121
|
+
|
122
|
+
<dt id="DEVICE_MODE-constant" class="">DEVICE_MODE =
|
123
|
+
<div class="docstring">
|
124
|
+
<div class="discussion">
|
125
|
+
|
126
|
+
<p>Device modes that determines geating scheduling.</p>
|
127
|
+
|
128
|
+
|
129
|
+
</div>
|
130
|
+
</div>
|
131
|
+
<div class="tags">
|
132
|
+
|
133
|
+
|
134
|
+
</div>
|
135
|
+
</dt>
|
136
|
+
<dd><pre class="code"><span class='qsymbols_beg'>%i[</span><span class='tstring_content'>auto</span><span class='words_sep'> </span><span class='tstring_content'>manual</span><span class='words_sep'> </span><span class='tstring_content'>vacation</span><span class='words_sep'> </span><span class='tstring_content'>boost</span><span class='tstring_end'>]</span></span><span class='period'>.</span><span class='id identifier rubyid_freeze'>freeze</span></pre></dd>
|
137
|
+
|
138
|
+
<dt id="DEVICE_TYPE-constant" class="">DEVICE_TYPE =
|
139
|
+
<div class="docstring">
|
140
|
+
<div class="discussion">
|
141
|
+
|
142
|
+
<p>Device types identified in Cube protocol.</p>
|
143
|
+
|
144
|
+
|
145
|
+
</div>
|
146
|
+
</div>
|
147
|
+
<div class="tags">
|
148
|
+
|
149
|
+
|
150
|
+
</div>
|
151
|
+
</dt>
|
152
|
+
<dd><pre class="code"><span class='qsymbols_beg'>%i[</span><span class='tstring_content'>cube</span><span class='words_sep'>
|
153
|
+
</span><span class='tstring_content'>radiator_thermostat</span><span class='words_sep'> </span><span class='tstring_content'>radiator_thermostat_plus</span><span class='words_sep'>
|
154
|
+
</span><span class='tstring_content'>wall_thermostat</span><span class='words_sep'>
|
155
|
+
</span><span class='tstring_content'>shutter_contact</span><span class='words_sep'> </span><span class='tstring_content'>eco_switch</span><span class='tstring_end'>]</span></span><span class='period'>.</span><span class='id identifier rubyid_freeze'>freeze</span></pre></dd>
|
156
|
+
|
157
|
+
<dt id="DAYS_OF_WEEK-constant" class="">DAYS_OF_WEEK =
|
158
|
+
<div class="docstring">
|
159
|
+
<div class="discussion">
|
160
|
+
|
161
|
+
<p>Names of days of week in order Cube protocol uses.</p>
|
162
|
+
|
163
|
+
|
164
|
+
</div>
|
165
|
+
</div>
|
166
|
+
<div class="tags">
|
167
|
+
|
168
|
+
|
169
|
+
</div>
|
170
|
+
</dt>
|
171
|
+
<dd><pre class="code"><span class='qwords_beg'>%w[</span><span class='tstring_content'>Saturday</span><span class='words_sep'> </span><span class='tstring_content'>Sunday</span><span class='words_sep'> </span><span class='tstring_content'>Monday</span><span class='words_sep'>
|
172
|
+
</span><span class='tstring_content'>Tuesday</span><span class='words_sep'> </span><span class='tstring_content'>Wednesday</span><span class='words_sep'> </span><span class='tstring_content'>Thursday</span><span class='words_sep'> </span><span class='tstring_content'>Friday</span><span class='tstring_end'>]</span></span><span class='period'>.</span><span class='id identifier rubyid_freeze'>freeze</span></pre></dd>
|
173
|
+
|
174
|
+
</dl>
|
175
|
+
|
176
|
+
|
177
|
+
|
178
|
+
|
179
|
+
|
180
|
+
|
181
|
+
|
182
|
+
|
183
|
+
<h2>
|
184
|
+
Instance Method Summary
|
185
|
+
<small><a href="#" class="summary_toggle">collapse</a></small>
|
186
|
+
</h2>
|
187
|
+
|
188
|
+
<ul class="summary">
|
189
|
+
|
190
|
+
<li class="private ">
|
191
|
+
<span class="summary_signature">
|
192
|
+
|
193
|
+
<a href="#ary_elem-instance_method" title="#ary_elem (instance method)">#<strong>ary_elem</strong>(ary, id, info) ⇒ Object </a>
|
194
|
+
|
195
|
+
|
196
|
+
|
197
|
+
</span>
|
198
|
+
|
199
|
+
|
200
|
+
|
201
|
+
<span class="note title private">private</span>
|
202
|
+
|
203
|
+
|
204
|
+
|
205
|
+
|
206
|
+
|
207
|
+
<span class="summary_desc"><div class='inline'>
|
208
|
+
<p>Helper method that checks presence of index in array (if not, exception is
|
209
|
+
raised).</p>
|
210
|
+
</div></span>
|
211
|
+
|
212
|
+
</li>
|
213
|
+
|
214
|
+
|
215
|
+
<li class="private ">
|
216
|
+
<span class="summary_signature">
|
217
|
+
|
218
|
+
<a href="#ary_elem_id-instance_method" title="#ary_elem_id (instance method)">#<strong>ary_elem_id</strong>(ary, elem, info) ⇒ Object </a>
|
219
|
+
|
220
|
+
|
221
|
+
|
222
|
+
</span>
|
223
|
+
|
224
|
+
|
225
|
+
|
226
|
+
<span class="note title private">private</span>
|
227
|
+
|
228
|
+
|
229
|
+
|
230
|
+
|
231
|
+
|
232
|
+
<span class="summary_desc"><div class='inline'>
|
233
|
+
<p>Reverse method to <span class='object_link'><a href="#ary_elem-instance_method" title="MaxCube::Messages#ary_elem (method)">#ary_elem</a></span>.</p>
|
234
|
+
</div></span>
|
235
|
+
|
236
|
+
</li>
|
237
|
+
|
238
|
+
|
239
|
+
<li class="private ">
|
240
|
+
<span class="summary_signature">
|
241
|
+
|
242
|
+
<a href="#conv_args-instance_method" title="#conv_args (instance method)">#<strong>conv_args</strong>(type, info, *args) { ... } ⇒ Array </a>
|
243
|
+
|
244
|
+
|
245
|
+
|
246
|
+
</span>
|
247
|
+
|
248
|
+
|
249
|
+
|
250
|
+
<span class="note title private">private</span>
|
251
|
+
|
252
|
+
|
253
|
+
|
254
|
+
|
255
|
+
|
256
|
+
<span class="summary_desc"><div class='inline'>
|
257
|
+
<p>Applies a block to given arguments in order to perform conversion to
|
258
|
+
certain type.</p>
|
259
|
+
</div></span>
|
260
|
+
|
261
|
+
</li>
|
262
|
+
|
263
|
+
|
264
|
+
<li class="private ">
|
265
|
+
<span class="summary_signature">
|
266
|
+
|
267
|
+
<a href="#day_of_week-instance_method" title="#day_of_week (instance method)">#<strong>day_of_week</strong>(day_id) ⇒ Object </a>
|
268
|
+
|
269
|
+
|
270
|
+
|
271
|
+
</span>
|
272
|
+
|
273
|
+
|
274
|
+
|
275
|
+
<span class="note title private">private</span>
|
276
|
+
|
277
|
+
|
278
|
+
|
279
|
+
|
280
|
+
|
281
|
+
<span class="summary_desc"><div class='inline'>
|
282
|
+
<p>Uses <span class='object_link'><a href="#ary_elem-instance_method" title="MaxCube::Messages#ary_elem (method)">#ary_elem</a></span> with <span class='object_link'><a href="#DAYS_OF_WEEK-constant" title="MaxCube::Messages::DAYS_OF_WEEK (constant)">DAYS_OF_WEEK</a></span>.</p>
|
283
|
+
</div></span>
|
284
|
+
|
285
|
+
</li>
|
286
|
+
|
287
|
+
|
288
|
+
<li class="private ">
|
289
|
+
<span class="summary_signature">
|
290
|
+
|
291
|
+
<a href="#day_of_week_id-instance_method" title="#day_of_week_id (instance method)">#<strong>day_of_week_id</strong>(day) ⇒ Object </a>
|
292
|
+
|
293
|
+
|
294
|
+
|
295
|
+
</span>
|
296
|
+
|
297
|
+
|
298
|
+
|
299
|
+
<span class="note title private">private</span>
|
300
|
+
|
301
|
+
|
302
|
+
|
303
|
+
|
304
|
+
|
305
|
+
<span class="summary_desc"><div class='inline'>
|
306
|
+
<p>Uses <span class='object_link'><a href="#ary_elem_id-instance_method" title="MaxCube::Messages#ary_elem_id (method)">#ary_elem_id</a></span> with <span class='object_link'><a href="#DAYS_OF_WEEK-constant" title="MaxCube::Messages::DAYS_OF_WEEK (constant)">DAYS_OF_WEEK</a></span>.</p>
|
307
|
+
</div></span>
|
308
|
+
|
309
|
+
</li>
|
310
|
+
|
311
|
+
|
312
|
+
<li class="private ">
|
313
|
+
<span class="summary_signature">
|
314
|
+
|
315
|
+
<a href="#device_mode-instance_method" title="#device_mode (instance method)">#<strong>device_mode</strong>(device_mode_id) ⇒ Object </a>
|
316
|
+
|
317
|
+
|
318
|
+
|
319
|
+
</span>
|
320
|
+
|
321
|
+
|
322
|
+
|
323
|
+
<span class="note title private">private</span>
|
324
|
+
|
325
|
+
|
326
|
+
|
327
|
+
|
328
|
+
|
329
|
+
<span class="summary_desc"><div class='inline'>
|
330
|
+
<p>Uses <span class='object_link'><a href="#ary_elem-instance_method" title="MaxCube::Messages#ary_elem (method)">#ary_elem</a></span> with <span class='object_link'><a href="#DEVICE_MODE-constant" title="MaxCube::Messages::DEVICE_MODE (constant)">DEVICE_MODE</a></span>.</p>
|
331
|
+
</div></span>
|
332
|
+
|
333
|
+
</li>
|
334
|
+
|
335
|
+
|
336
|
+
<li class="private ">
|
337
|
+
<span class="summary_signature">
|
338
|
+
|
339
|
+
<a href="#device_mode_id-instance_method" title="#device_mode_id (instance method)">#<strong>device_mode_id</strong>(device_mode) ⇒ Object </a>
|
340
|
+
|
341
|
+
|
342
|
+
|
343
|
+
</span>
|
344
|
+
|
345
|
+
|
346
|
+
|
347
|
+
<span class="note title private">private</span>
|
348
|
+
|
349
|
+
|
350
|
+
|
351
|
+
|
352
|
+
|
353
|
+
<span class="summary_desc"><div class='inline'>
|
354
|
+
<p>Uses <span class='object_link'><a href="#ary_elem_id-instance_method" title="MaxCube::Messages#ary_elem_id (method)">#ary_elem_id</a></span> with <span class='object_link'><a href="#DEVICE_MODE-constant" title="MaxCube::Messages::DEVICE_MODE (constant)">DEVICE_MODE</a></span>.</p>
|
355
|
+
</div></span>
|
356
|
+
|
357
|
+
</li>
|
358
|
+
|
359
|
+
|
360
|
+
<li class="private ">
|
361
|
+
<span class="summary_signature">
|
362
|
+
|
363
|
+
<a href="#device_type-instance_method" title="#device_type (instance method)">#<strong>device_type</strong>(device_type_id) ⇒ Object </a>
|
364
|
+
|
365
|
+
|
366
|
+
|
367
|
+
</span>
|
368
|
+
|
369
|
+
|
370
|
+
|
371
|
+
<span class="note title private">private</span>
|
372
|
+
|
373
|
+
|
374
|
+
|
375
|
+
|
376
|
+
|
377
|
+
<span class="summary_desc"><div class='inline'>
|
378
|
+
<p>Uses <span class='object_link'><a href="#ary_elem-instance_method" title="MaxCube::Messages#ary_elem (method)">#ary_elem</a></span> with <span class='object_link'><a href="#DEVICE_TYPE-constant" title="MaxCube::Messages::DEVICE_TYPE (constant)">DEVICE_TYPE</a></span>.</p>
|
379
|
+
</div></span>
|
380
|
+
|
381
|
+
</li>
|
382
|
+
|
383
|
+
|
384
|
+
<li class="private ">
|
385
|
+
<span class="summary_signature">
|
386
|
+
|
387
|
+
<a href="#device_type_id-instance_method" title="#device_type_id (instance method)">#<strong>device_type_id</strong>(device_type) ⇒ Object </a>
|
388
|
+
|
389
|
+
|
390
|
+
|
391
|
+
</span>
|
392
|
+
|
393
|
+
|
394
|
+
|
395
|
+
<span class="note title private">private</span>
|
396
|
+
|
397
|
+
|
398
|
+
|
399
|
+
|
400
|
+
|
401
|
+
<span class="summary_desc"><div class='inline'>
|
402
|
+
<p>Uses <span class='object_link'><a href="#ary_elem_id-instance_method" title="MaxCube::Messages#ary_elem_id (method)">#ary_elem_id</a></span> with <span class='object_link'><a href="#DEVICE_TYPE-constant" title="MaxCube::Messages::DEVICE_TYPE (constant)">DEVICE_TYPE</a></span>.</p>
|
403
|
+
</div></span>
|
404
|
+
|
405
|
+
</li>
|
406
|
+
|
407
|
+
|
408
|
+
<li class="private ">
|
409
|
+
<span class="summary_signature">
|
410
|
+
|
411
|
+
<a href="#to_bool-instance_method" title="#to_bool (instance method)">#<strong>to_bool</strong>(info, arg) ⇒ Boolean </a>
|
412
|
+
|
413
|
+
|
414
|
+
|
415
|
+
</span>
|
416
|
+
|
417
|
+
|
418
|
+
|
419
|
+
<span class="note title private">private</span>
|
420
|
+
|
421
|
+
|
422
|
+
|
423
|
+
|
424
|
+
|
425
|
+
<span class="summary_desc"><div class='inline'>
|
426
|
+
<p>Uses <span class='object_link'><a href="#to_bools-instance_method" title="MaxCube::Messages#to_bools (method)">#to_bools</a></span>, but operates with single argument.</p>
|
427
|
+
</div></span>
|
428
|
+
|
429
|
+
</li>
|
430
|
+
|
431
|
+
|
432
|
+
<li class="private ">
|
433
|
+
<span class="summary_signature">
|
434
|
+
|
435
|
+
<a href="#to_bools-instance_method" title="#to_bools (instance method)">#<strong>to_bools</strong>(info, *args) ⇒ Array<Boolean> </a>
|
436
|
+
|
437
|
+
|
438
|
+
|
439
|
+
</span>
|
440
|
+
|
441
|
+
|
442
|
+
|
443
|
+
<span class="note title private">private</span>
|
444
|
+
|
445
|
+
|
446
|
+
|
447
|
+
|
448
|
+
|
449
|
+
<span class="summary_desc"><div class='inline'>
|
450
|
+
<p>Uses <span class='object_link'><a href="#conv_args-instance_method" title="MaxCube::Messages#conv_args (method)">#conv_args</a></span> to convert objects to bools.</p>
|
451
|
+
</div></span>
|
452
|
+
|
453
|
+
</li>
|
454
|
+
|
455
|
+
|
456
|
+
<li class="private ">
|
457
|
+
<span class="summary_signature">
|
458
|
+
|
459
|
+
<a href="#to_datetime-instance_method" title="#to_datetime (instance method)">#<strong>to_datetime</strong>(info, arg) ⇒ Time </a>
|
460
|
+
|
461
|
+
|
462
|
+
|
463
|
+
</span>
|
464
|
+
|
465
|
+
|
466
|
+
|
467
|
+
<span class="note title private">private</span>
|
468
|
+
|
469
|
+
|
470
|
+
|
471
|
+
|
472
|
+
|
473
|
+
<span class="summary_desc"><div class='inline'>
|
474
|
+
<p>Uses <span class='object_link'><a href="#to_datetime-instance_method" title="MaxCube::Messages#to_datetime (method)">#to_datetime</a></span>, but operates with single argument.</p>
|
475
|
+
</div></span>
|
476
|
+
|
477
|
+
</li>
|
478
|
+
|
479
|
+
|
480
|
+
<li class="private ">
|
481
|
+
<span class="summary_signature">
|
482
|
+
|
483
|
+
<a href="#to_datetimes-instance_method" title="#to_datetimes (instance method)">#<strong>to_datetimes</strong>(info, *args) ⇒ Array<Time> </a>
|
484
|
+
|
485
|
+
|
486
|
+
|
487
|
+
</span>
|
488
|
+
|
489
|
+
|
490
|
+
|
491
|
+
<span class="note title private">private</span>
|
492
|
+
|
493
|
+
|
494
|
+
|
495
|
+
|
496
|
+
|
497
|
+
<span class="summary_desc"><div class='inline'>
|
498
|
+
<p>Uses <span class='object_link'><a href="#conv_args-instance_method" title="MaxCube::Messages#conv_args (method)">#conv_args</a></span> to convert objects to <code>Time</code>.</p>
|
499
|
+
</div></span>
|
500
|
+
|
501
|
+
</li>
|
502
|
+
|
503
|
+
|
504
|
+
<li class="private ">
|
505
|
+
<span class="summary_signature">
|
506
|
+
|
507
|
+
<a href="#to_float-instance_method" title="#to_float (instance method)">#<strong>to_float</strong>(info, arg) ⇒ Float </a>
|
508
|
+
|
509
|
+
|
510
|
+
|
511
|
+
</span>
|
512
|
+
|
513
|
+
|
514
|
+
|
515
|
+
<span class="note title private">private</span>
|
516
|
+
|
517
|
+
|
518
|
+
|
519
|
+
|
520
|
+
|
521
|
+
<span class="summary_desc"><div class='inline'>
|
522
|
+
<p>Uses <span class='object_link'><a href="#to_floats-instance_method" title="MaxCube::Messages#to_floats (method)">#to_floats</a></span>, but operates with single argument.</p>
|
523
|
+
</div></span>
|
524
|
+
|
525
|
+
</li>
|
526
|
+
|
527
|
+
|
528
|
+
<li class="private ">
|
529
|
+
<span class="summary_signature">
|
530
|
+
|
531
|
+
<a href="#to_floats-instance_method" title="#to_floats (instance method)">#<strong>to_floats</strong>(info, *args) ⇒ Array<Float> </a>
|
532
|
+
|
533
|
+
|
534
|
+
|
535
|
+
</span>
|
536
|
+
|
537
|
+
|
538
|
+
|
539
|
+
<span class="note title private">private</span>
|
540
|
+
|
541
|
+
|
542
|
+
|
543
|
+
|
544
|
+
|
545
|
+
<span class="summary_desc"><div class='inline'>
|
546
|
+
<p>Uses <span class='object_link'><a href="#conv_args-instance_method" title="MaxCube::Messages#conv_args (method)">#conv_args</a></span> to convert numbers or string of characters (not binary
|
547
|
+
data!) to floats.</p>
|
548
|
+
</div></span>
|
549
|
+
|
550
|
+
</li>
|
551
|
+
|
552
|
+
|
553
|
+
<li class="private ">
|
554
|
+
<span class="summary_signature">
|
555
|
+
|
556
|
+
<a href="#to_int-instance_method" title="#to_int (instance method)">#<strong>to_int</strong>(base, info, arg) ⇒ Integer </a>
|
557
|
+
|
558
|
+
|
559
|
+
|
560
|
+
</span>
|
561
|
+
|
562
|
+
|
563
|
+
|
564
|
+
<span class="note title private">private</span>
|
565
|
+
|
566
|
+
|
567
|
+
|
568
|
+
|
569
|
+
|
570
|
+
<span class="summary_desc"><div class='inline'>
|
571
|
+
<p>Uses <span class='object_link'><a href="#to_ints-instance_method" title="MaxCube::Messages#to_ints (method)">#to_ints</a></span>, but operates with single argument.</p>
|
572
|
+
</div></span>
|
573
|
+
|
574
|
+
</li>
|
575
|
+
|
576
|
+
|
577
|
+
<li class="private ">
|
578
|
+
<span class="summary_signature">
|
579
|
+
|
580
|
+
<a href="#to_ints-instance_method" title="#to_ints (instance method)">#<strong>to_ints</strong>(base, info, *args) ⇒ Array<Integer> </a>
|
581
|
+
|
582
|
+
|
583
|
+
|
584
|
+
</span>
|
585
|
+
|
586
|
+
|
587
|
+
|
588
|
+
<span class="note title private">private</span>
|
589
|
+
|
590
|
+
|
591
|
+
|
592
|
+
|
593
|
+
|
594
|
+
<span class="summary_desc"><div class='inline'>
|
595
|
+
<p>Uses <span class='object_link'><a href="#conv_args-instance_method" title="MaxCube::Messages#conv_args (method)">#conv_args</a></span> to convert numbers or string of characters (not binary
|
596
|
+
data!) to integers in given base (radix).</p>
|
597
|
+
</div></span>
|
598
|
+
|
599
|
+
</li>
|
600
|
+
|
601
|
+
|
602
|
+
</ul>
|
603
|
+
|
604
|
+
|
605
|
+
|
606
|
+
|
607
|
+
<div id="instance_method_details" class="method_details_list">
|
608
|
+
<h2>Instance Method Details</h2>
|
609
|
+
|
610
|
+
|
611
|
+
<div class="method_details first">
|
612
|
+
<h3 class="signature first" id="ary_elem-instance_method">
|
613
|
+
|
614
|
+
#<strong>ary_elem</strong>(ary, id, info) ⇒ <tt>Object</tt> <span class="extras">(private)</span>
|
615
|
+
|
616
|
+
|
617
|
+
|
618
|
+
|
619
|
+
|
620
|
+
</h3><div class="docstring">
|
621
|
+
<div class="discussion">
|
622
|
+
|
623
|
+
<p>Helper method that checks presence of index in array (if not, exception is
|
624
|
+
raised).</p>
|
625
|
+
|
626
|
+
|
627
|
+
</div>
|
628
|
+
</div>
|
629
|
+
<div class="tags">
|
630
|
+
<p class="tag_title">Parameters:</p>
|
631
|
+
<ul class="param">
|
632
|
+
|
633
|
+
<li>
|
634
|
+
|
635
|
+
<span class='name'>ary</span>
|
636
|
+
|
637
|
+
|
638
|
+
<span class='type'>(<tt>#[]</tt>)</span>
|
639
|
+
|
640
|
+
|
641
|
+
|
642
|
+
—
|
643
|
+
<div class='inline'>
|
644
|
+
<p>input container (usually constant).</p>
|
645
|
+
</div>
|
646
|
+
|
647
|
+
</li>
|
648
|
+
|
649
|
+
<li>
|
650
|
+
|
651
|
+
<span class='name'>id</span>
|
652
|
+
|
653
|
+
|
654
|
+
<span class='type'></span>
|
655
|
+
|
656
|
+
|
657
|
+
|
658
|
+
—
|
659
|
+
<div class='inline'>
|
660
|
+
<p>index of element in container.</p>
|
661
|
+
</div>
|
662
|
+
|
663
|
+
</li>
|
664
|
+
|
665
|
+
<li>
|
666
|
+
|
667
|
+
<span class='name'>info</span>
|
668
|
+
|
669
|
+
|
670
|
+
<span class='type'>(<tt>#to_s</tt>)</span>
|
671
|
+
|
672
|
+
|
673
|
+
|
674
|
+
—
|
675
|
+
<div class='inline'>
|
676
|
+
<p>context information to pass to raised error.</p>
|
677
|
+
</div>
|
678
|
+
|
679
|
+
</li>
|
680
|
+
|
681
|
+
</ul>
|
682
|
+
|
683
|
+
<p class="tag_title">Returns:</p>
|
684
|
+
<ul class="return">
|
685
|
+
|
686
|
+
<li>
|
687
|
+
|
688
|
+
|
689
|
+
<span class='type'></span>
|
690
|
+
|
691
|
+
|
692
|
+
|
693
|
+
|
694
|
+
<div class='inline'>
|
695
|
+
<p>element of container if found.</p>
|
696
|
+
</div>
|
697
|
+
|
698
|
+
</li>
|
699
|
+
|
700
|
+
</ul>
|
701
|
+
<p class="tag_title">Raises:</p>
|
702
|
+
<ul class="raise">
|
703
|
+
|
704
|
+
<li>
|
705
|
+
|
706
|
+
|
707
|
+
<span class='type'>(<tt><span class='object_link'><a href="Messages/InvalidMessageBody.html" title="MaxCube::Messages::InvalidMessageBody (class)">InvalidMessageBody</a></span></tt>)</span>
|
708
|
+
|
709
|
+
|
710
|
+
|
711
|
+
—
|
712
|
+
<div class='inline'>
|
713
|
+
<p>if element not found.</p>
|
714
|
+
</div>
|
715
|
+
|
716
|
+
</li>
|
717
|
+
|
718
|
+
</ul>
|
719
|
+
|
720
|
+
</div><table class="source_code">
|
721
|
+
<tr>
|
722
|
+
<td>
|
723
|
+
<pre class="lines">
|
724
|
+
|
725
|
+
|
726
|
+
176
|
727
|
+
177
|
728
|
+
178
|
729
|
+
179
|
730
|
+
180
|
731
|
+
181</pre>
|
732
|
+
</td>
|
733
|
+
<td>
|
734
|
+
<pre class="code"><span class="info file"># File 'lib/maxcube/messages.rb', line 176</span>
|
735
|
+
|
736
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_ary_elem'>ary_elem</span><span class='lparen'>(</span><span class='id identifier rubyid_ary'>ary</span><span class='comma'>,</span> <span class='id identifier rubyid_id'>id</span><span class='comma'>,</span> <span class='id identifier rubyid_info'>info</span><span class='rparen'>)</span>
|
737
|
+
<span class='id identifier rubyid_elem'>elem</span> <span class='op'>=</span> <span class='id identifier rubyid_ary'>ary</span><span class='lbracket'>[</span><span class='id identifier rubyid_id'>id</span><span class='rbracket'>]</span>
|
738
|
+
<span class='kw'>return</span> <span class='id identifier rubyid_elem'>elem</span> <span class='kw'>if</span> <span class='id identifier rubyid_elem'>elem</span>
|
739
|
+
<span class='id identifier rubyid_raise'>raise</span> <span class='const'><span class='object_link'><a href="Messages/InvalidMessageBody.html" title="MaxCube::Messages::InvalidMessageBody (class)">InvalidMessageBody</a></span></span>
|
740
|
+
<span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='ivar'>@msg_type</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>unrecognized </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_info'>info</span><span class='embexpr_end'>}</span><span class='tstring_content'> id: </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
741
|
+
<span class='kw'>end</span></pre>
|
742
|
+
</td>
|
743
|
+
</tr>
|
744
|
+
</table>
|
745
|
+
</div>
|
746
|
+
|
747
|
+
<div class="method_details ">
|
748
|
+
<h3 class="signature " id="ary_elem_id-instance_method">
|
749
|
+
|
750
|
+
#<strong>ary_elem_id</strong>(ary, elem, info) ⇒ <tt>Object</tt> <span class="extras">(private)</span>
|
751
|
+
|
752
|
+
|
753
|
+
|
754
|
+
|
755
|
+
|
756
|
+
</h3><div class="docstring">
|
757
|
+
<div class="discussion">
|
758
|
+
|
759
|
+
<p>Reverse method to <span class='object_link'><a href="#ary_elem-instance_method" title="MaxCube::Messages#ary_elem (method)">#ary_elem</a></span>.</p>
|
760
|
+
|
761
|
+
|
762
|
+
</div>
|
763
|
+
</div>
|
764
|
+
<div class="tags">
|
765
|
+
|
766
|
+
<p class="tag_title">Raises:</p>
|
767
|
+
<ul class="raise">
|
768
|
+
|
769
|
+
<li>
|
770
|
+
|
771
|
+
|
772
|
+
<span class='type'>(<tt><span class='object_link'><a href="Messages/InvalidMessageBody.html" title="MaxCube::Messages::InvalidMessageBody (class)">InvalidMessageBody</a></span></tt>)</span>
|
773
|
+
|
774
|
+
|
775
|
+
|
776
|
+
</li>
|
777
|
+
|
778
|
+
</ul>
|
779
|
+
|
780
|
+
</div><table class="source_code">
|
781
|
+
<tr>
|
782
|
+
<td>
|
783
|
+
<pre class="lines">
|
784
|
+
|
785
|
+
|
786
|
+
184
|
787
|
+
185
|
788
|
+
186
|
789
|
+
187
|
790
|
+
188
|
791
|
+
189</pre>
|
792
|
+
</td>
|
793
|
+
<td>
|
794
|
+
<pre class="code"><span class="info file"># File 'lib/maxcube/messages.rb', line 184</span>
|
795
|
+
|
796
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_ary_elem_id'>ary_elem_id</span><span class='lparen'>(</span><span class='id identifier rubyid_ary'>ary</span><span class='comma'>,</span> <span class='id identifier rubyid_elem'>elem</span><span class='comma'>,</span> <span class='id identifier rubyid_info'>info</span><span class='rparen'>)</span>
|
797
|
+
<span class='id identifier rubyid_id'>id</span> <span class='op'>=</span> <span class='id identifier rubyid_ary'>ary</span><span class='period'>.</span><span class='id identifier rubyid_index'>index</span><span class='lparen'>(</span><span class='id identifier rubyid_elem'>elem</span><span class='rparen'>)</span>
|
798
|
+
<span class='kw'>return</span> <span class='id identifier rubyid_id'>id</span> <span class='kw'>if</span> <span class='id identifier rubyid_id'>id</span>
|
799
|
+
<span class='id identifier rubyid_raise'>raise</span> <span class='const'><span class='object_link'><a href="Messages/InvalidMessageBody.html" title="MaxCube::Messages::InvalidMessageBody (class)">InvalidMessageBody</a></span></span>
|
800
|
+
<span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='ivar'>@msg_type</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>unrecognized </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_info'>info</span><span class='embexpr_end'>}</span><span class='tstring_content'>: </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_elem'>elem</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
801
|
+
<span class='kw'>end</span></pre>
|
802
|
+
</td>
|
803
|
+
</tr>
|
804
|
+
</table>
|
805
|
+
</div>
|
806
|
+
|
807
|
+
<div class="method_details ">
|
808
|
+
<h3 class="signature " id="conv_args-instance_method">
|
809
|
+
|
810
|
+
#<strong>conv_args</strong>(type, info, *args) { ... } ⇒ <tt>Array</tt> <span class="extras">(private)</span>
|
811
|
+
|
812
|
+
|
813
|
+
|
814
|
+
|
815
|
+
|
816
|
+
</h3><div class="docstring">
|
817
|
+
<div class="discussion">
|
818
|
+
|
819
|
+
<p>Applies a block to given arguments in order to perform conversion to
|
820
|
+
certain type. If conversion fails, <span class='object_link'><a href="Messages/InvalidMessageBody.html" title="MaxCube::Messages::InvalidMessageBody (class)">InvalidMessageBody</a></span> is raised. Thus,
|
821
|
+
this method can be used also for type checking purposes only.</p>
|
822
|
+
|
823
|
+
|
824
|
+
</div>
|
825
|
+
</div>
|
826
|
+
<div class="tags">
|
827
|
+
<p class="tag_title">Parameters:</p>
|
828
|
+
<ul class="param">
|
829
|
+
|
830
|
+
<li>
|
831
|
+
|
832
|
+
<span class='name'>type</span>
|
833
|
+
|
834
|
+
|
835
|
+
<span class='type'>(<tt>#to_s</tt>)</span>
|
836
|
+
|
837
|
+
|
838
|
+
|
839
|
+
—
|
840
|
+
<div class='inline'>
|
841
|
+
<p>name of the type to convert to.</p>
|
842
|
+
</div>
|
843
|
+
|
844
|
+
</li>
|
845
|
+
|
846
|
+
<li>
|
847
|
+
|
848
|
+
<span class='name'>info</span>
|
849
|
+
|
850
|
+
|
851
|
+
<span class='type'>(<tt>#to_s</tt>)</span>
|
852
|
+
|
853
|
+
|
854
|
+
|
855
|
+
—
|
856
|
+
<div class='inline'>
|
857
|
+
<p>context information to pass to raised error.</p>
|
858
|
+
</div>
|
859
|
+
|
860
|
+
</li>
|
861
|
+
|
862
|
+
<li>
|
863
|
+
|
864
|
+
<span class='name'>args</span>
|
865
|
+
|
866
|
+
|
867
|
+
<span class='type'>(<tt>Array</tt>)</span>
|
868
|
+
|
869
|
+
|
870
|
+
|
871
|
+
—
|
872
|
+
<div class='inline'>
|
873
|
+
<p>arguments to be converted into the same type.</p>
|
874
|
+
</div>
|
875
|
+
|
876
|
+
</li>
|
877
|
+
|
878
|
+
</ul>
|
879
|
+
|
880
|
+
<p class="tag_title">Yields:</p>
|
881
|
+
<ul class="yield">
|
882
|
+
|
883
|
+
<li>
|
884
|
+
|
885
|
+
|
886
|
+
<span class='type'></span>
|
887
|
+
|
888
|
+
|
889
|
+
|
890
|
+
|
891
|
+
<div class='inline'>
|
892
|
+
<p>a rule to provide certain type check and conversion of arguments.</p>
|
893
|
+
</div>
|
894
|
+
|
895
|
+
</li>
|
896
|
+
|
897
|
+
</ul>
|
898
|
+
<p class="tag_title">Returns:</p>
|
899
|
+
<ul class="return">
|
900
|
+
|
901
|
+
<li>
|
902
|
+
|
903
|
+
|
904
|
+
<span class='type'>(<tt>Array</tt>)</span>
|
905
|
+
|
906
|
+
|
907
|
+
|
908
|
+
—
|
909
|
+
<div class='inline'>
|
910
|
+
<p>converted elements.</p>
|
911
|
+
</div>
|
912
|
+
|
913
|
+
</li>
|
914
|
+
|
915
|
+
</ul>
|
916
|
+
<p class="tag_title">Raises:</p>
|
917
|
+
<ul class="raise">
|
918
|
+
|
919
|
+
<li>
|
920
|
+
|
921
|
+
|
922
|
+
<span class='type'>(<tt><span class='object_link'><a href="Messages/InvalidMessageBody.html" title="MaxCube::Messages::InvalidMessageBody (class)">InvalidMessageBody</a></span></tt>)</span>
|
923
|
+
|
924
|
+
|
925
|
+
|
926
|
+
—
|
927
|
+
<div class='inline'>
|
928
|
+
<p>if conversion fails.</p>
|
929
|
+
</div>
|
930
|
+
|
931
|
+
</li>
|
932
|
+
|
933
|
+
</ul>
|
934
|
+
|
935
|
+
</div><table class="source_code">
|
936
|
+
<tr>
|
937
|
+
<td>
|
938
|
+
<pre class="lines">
|
939
|
+
|
940
|
+
|
941
|
+
74
|
942
|
+
75
|
943
|
+
76
|
944
|
+
77
|
945
|
+
78
|
946
|
+
79
|
947
|
+
80
|
948
|
+
81</pre>
|
949
|
+
</td>
|
950
|
+
<td>
|
951
|
+
<pre class="code"><span class="info file"># File 'lib/maxcube/messages.rb', line 74</span>
|
952
|
+
|
953
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_conv_args'>conv_args</span><span class='lparen'>(</span><span class='id identifier rubyid_type'>type</span><span class='comma'>,</span> <span class='id identifier rubyid_info'>info</span><span class='comma'>,</span> <span class='op'>*</span><span class='id identifier rubyid_args'>args</span><span class='comma'>,</span> <span class='op'>&</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
|
954
|
+
<span class='id identifier rubyid_info'>info</span> <span class='op'>=</span> <span class='id identifier rubyid_info'>info</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='period'>.</span><span class='id identifier rubyid_tr'>tr</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='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'> </span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
|
955
|
+
<span class='id identifier rubyid_args'>args</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span><span class='lparen'>(</span><span class='op'>&</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
|
956
|
+
<span class='kw'>rescue</span> <span class='const'>ArgumentError</span><span class='comma'>,</span> <span class='const'>TypeError</span>
|
957
|
+
<span class='id identifier rubyid_raise'>raise</span> <span class='const'><span class='object_link'><a href="Messages/InvalidMessageBody.html" title="MaxCube::Messages::InvalidMessageBody (class)">InvalidMessageBody</a></span></span>
|
958
|
+
<span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='ivar'>@msg_type</span><span class='comma'>,</span>
|
959
|
+
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>invalid </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_type'>type</span><span class='embexpr_end'>}</span><span class='tstring_content'> format of arguments </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_args'>args</span><span class='embexpr_end'>}</span><span class='tstring_content'> (</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_info'>info</span><span class='embexpr_end'>}</span><span class='tstring_content'>)</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
960
|
+
<span class='kw'>end</span></pre>
|
961
|
+
</td>
|
962
|
+
</tr>
|
963
|
+
</table>
|
964
|
+
</div>
|
965
|
+
|
966
|
+
<div class="method_details ">
|
967
|
+
<h3 class="signature " id="day_of_week-instance_method">
|
968
|
+
|
969
|
+
#<strong>day_of_week</strong>(day_id) ⇒ <tt>Object</tt> <span class="extras">(private)</span>
|
970
|
+
|
971
|
+
|
972
|
+
|
973
|
+
|
974
|
+
|
975
|
+
</h3><div class="docstring">
|
976
|
+
<div class="discussion">
|
977
|
+
|
978
|
+
<p>Uses <span class='object_link'><a href="#ary_elem-instance_method" title="MaxCube::Messages#ary_elem (method)">#ary_elem</a></span> with <span class='object_link'><a href="#DAYS_OF_WEEK-constant" title="MaxCube::Messages::DAYS_OF_WEEK (constant)">DAYS_OF_WEEK</a></span></p>
|
979
|
+
|
980
|
+
|
981
|
+
</div>
|
982
|
+
</div>
|
983
|
+
<div class="tags">
|
984
|
+
|
985
|
+
|
986
|
+
</div><table class="source_code">
|
987
|
+
<tr>
|
988
|
+
<td>
|
989
|
+
<pre class="lines">
|
990
|
+
|
991
|
+
|
992
|
+
212
|
993
|
+
213
|
994
|
+
214</pre>
|
995
|
+
</td>
|
996
|
+
<td>
|
997
|
+
<pre class="code"><span class="info file"># File 'lib/maxcube/messages.rb', line 212</span>
|
998
|
+
|
999
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_day_of_week'>day_of_week</span><span class='lparen'>(</span><span class='id identifier rubyid_day_id'>day_id</span><span class='rparen'>)</span>
|
1000
|
+
<span class='id identifier rubyid_ary_elem'>ary_elem</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="#DAYS_OF_WEEK-constant" title="MaxCube::Messages::DAYS_OF_WEEK (constant)">DAYS_OF_WEEK</a></span></span><span class='comma'>,</span> <span class='id identifier rubyid_day_id'>day_id</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>day of week</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
|
1001
|
+
<span class='kw'>end</span></pre>
|
1002
|
+
</td>
|
1003
|
+
</tr>
|
1004
|
+
</table>
|
1005
|
+
</div>
|
1006
|
+
|
1007
|
+
<div class="method_details ">
|
1008
|
+
<h3 class="signature " id="day_of_week_id-instance_method">
|
1009
|
+
|
1010
|
+
#<strong>day_of_week_id</strong>(day) ⇒ <tt>Object</tt> <span class="extras">(private)</span>
|
1011
|
+
|
1012
|
+
|
1013
|
+
|
1014
|
+
|
1015
|
+
|
1016
|
+
</h3><div class="docstring">
|
1017
|
+
<div class="discussion">
|
1018
|
+
|
1019
|
+
<p>Uses <span class='object_link'><a href="#ary_elem_id-instance_method" title="MaxCube::Messages#ary_elem_id (method)">#ary_elem_id</a></span> with <span class='object_link'><a href="#DAYS_OF_WEEK-constant" title="MaxCube::Messages::DAYS_OF_WEEK (constant)">DAYS_OF_WEEK</a></span></p>
|
1020
|
+
|
1021
|
+
|
1022
|
+
</div>
|
1023
|
+
</div>
|
1024
|
+
<div class="tags">
|
1025
|
+
|
1026
|
+
|
1027
|
+
</div><table class="source_code">
|
1028
|
+
<tr>
|
1029
|
+
<td>
|
1030
|
+
<pre class="lines">
|
1031
|
+
|
1032
|
+
|
1033
|
+
217
|
1034
|
+
218
|
1035
|
+
219
|
1036
|
+
220
|
1037
|
+
221
|
1038
|
+
222</pre>
|
1039
|
+
</td>
|
1040
|
+
<td>
|
1041
|
+
<pre class="code"><span class="info file"># File 'lib/maxcube/messages.rb', line 217</span>
|
1042
|
+
|
1043
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_day_of_week_id'>day_of_week_id</span><span class='lparen'>(</span><span class='id identifier rubyid_day'>day</span><span class='rparen'>)</span>
|
1044
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_day'>day</span><span class='period'>.</span><span class='id identifier rubyid_respond_to?'>respond_to?</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>to_i</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span> <span class='op'>&&</span> <span class='id identifier rubyid_day'>day</span><span class='period'>.</span><span class='id identifier rubyid_to_i'>to_i</span><span class='period'>.</span><span class='id identifier rubyid_between?'>between?</span><span class='lparen'>(</span><span class='int'>1</span><span class='comma'>,</span> <span class='int'>7</span><span class='rparen'>)</span>
|
1045
|
+
<span class='kw'>return</span> <span class='lparen'>(</span><span class='id identifier rubyid_day'>day</span><span class='period'>.</span><span class='id identifier rubyid_to_i'>to_i</span> <span class='op'>+</span> <span class='int'>1</span><span class='rparen'>)</span> <span class='op'>%</span> <span class='int'>7</span>
|
1046
|
+
<span class='kw'>end</span>
|
1047
|
+
<span class='id identifier rubyid_ary_elem_id'>ary_elem_id</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="#DAYS_OF_WEEK-constant" title="MaxCube::Messages::DAYS_OF_WEEK (constant)">DAYS_OF_WEEK</a></span></span><span class='comma'>,</span> <span class='id identifier rubyid_day'>day</span><span class='period'>.</span><span class='id identifier rubyid_capitalize'>capitalize</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>day of week</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
|
1048
|
+
<span class='kw'>end</span></pre>
|
1049
|
+
</td>
|
1050
|
+
</tr>
|
1051
|
+
</table>
|
1052
|
+
</div>
|
1053
|
+
|
1054
|
+
<div class="method_details ">
|
1055
|
+
<h3 class="signature " id="device_mode-instance_method">
|
1056
|
+
|
1057
|
+
#<strong>device_mode</strong>(device_mode_id) ⇒ <tt>Object</tt> <span class="extras">(private)</span>
|
1058
|
+
|
1059
|
+
|
1060
|
+
|
1061
|
+
|
1062
|
+
|
1063
|
+
</h3><div class="docstring">
|
1064
|
+
<div class="discussion">
|
1065
|
+
|
1066
|
+
<p>Uses <span class='object_link'><a href="#ary_elem-instance_method" title="MaxCube::Messages#ary_elem (method)">#ary_elem</a></span> with <span class='object_link'><a href="#DEVICE_MODE-constant" title="MaxCube::Messages::DEVICE_MODE (constant)">DEVICE_MODE</a></span></p>
|
1067
|
+
|
1068
|
+
|
1069
|
+
</div>
|
1070
|
+
</div>
|
1071
|
+
<div class="tags">
|
1072
|
+
|
1073
|
+
|
1074
|
+
</div><table class="source_code">
|
1075
|
+
<tr>
|
1076
|
+
<td>
|
1077
|
+
<pre class="lines">
|
1078
|
+
|
1079
|
+
|
1080
|
+
202
|
1081
|
+
203
|
1082
|
+
204</pre>
|
1083
|
+
</td>
|
1084
|
+
<td>
|
1085
|
+
<pre class="code"><span class="info file"># File 'lib/maxcube/messages.rb', line 202</span>
|
1086
|
+
|
1087
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_device_mode'>device_mode</span><span class='lparen'>(</span><span class='id identifier rubyid_device_mode_id'>device_mode_id</span><span class='rparen'>)</span>
|
1088
|
+
<span class='id identifier rubyid_ary_elem'>ary_elem</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="#DEVICE_MODE-constant" title="MaxCube::Messages::DEVICE_MODE (constant)">DEVICE_MODE</a></span></span><span class='comma'>,</span> <span class='id identifier rubyid_device_mode_id'>device_mode_id</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>device mode</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
|
1089
|
+
<span class='kw'>end</span></pre>
|
1090
|
+
</td>
|
1091
|
+
</tr>
|
1092
|
+
</table>
|
1093
|
+
</div>
|
1094
|
+
|
1095
|
+
<div class="method_details ">
|
1096
|
+
<h3 class="signature " id="device_mode_id-instance_method">
|
1097
|
+
|
1098
|
+
#<strong>device_mode_id</strong>(device_mode) ⇒ <tt>Object</tt> <span class="extras">(private)</span>
|
1099
|
+
|
1100
|
+
|
1101
|
+
|
1102
|
+
|
1103
|
+
|
1104
|
+
</h3><div class="docstring">
|
1105
|
+
<div class="discussion">
|
1106
|
+
|
1107
|
+
<p>Uses <span class='object_link'><a href="#ary_elem_id-instance_method" title="MaxCube::Messages#ary_elem_id (method)">#ary_elem_id</a></span> with <span class='object_link'><a href="#DEVICE_MODE-constant" title="MaxCube::Messages::DEVICE_MODE (constant)">DEVICE_MODE</a></span></p>
|
1108
|
+
|
1109
|
+
|
1110
|
+
</div>
|
1111
|
+
</div>
|
1112
|
+
<div class="tags">
|
1113
|
+
|
1114
|
+
|
1115
|
+
</div><table class="source_code">
|
1116
|
+
<tr>
|
1117
|
+
<td>
|
1118
|
+
<pre class="lines">
|
1119
|
+
|
1120
|
+
|
1121
|
+
207
|
1122
|
+
208
|
1123
|
+
209</pre>
|
1124
|
+
</td>
|
1125
|
+
<td>
|
1126
|
+
<pre class="code"><span class="info file"># File 'lib/maxcube/messages.rb', line 207</span>
|
1127
|
+
|
1128
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_device_mode_id'>device_mode_id</span><span class='lparen'>(</span><span class='id identifier rubyid_device_mode'>device_mode</span><span class='rparen'>)</span>
|
1129
|
+
<span class='id identifier rubyid_ary_elem_id'>ary_elem_id</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="#DEVICE_MODE-constant" title="MaxCube::Messages::DEVICE_MODE (constant)">DEVICE_MODE</a></span></span><span class='comma'>,</span> <span class='id identifier rubyid_device_mode'>device_mode</span><span class='period'>.</span><span class='id identifier rubyid_to_sym'>to_sym</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>device mode</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
|
1130
|
+
<span class='kw'>end</span></pre>
|
1131
|
+
</td>
|
1132
|
+
</tr>
|
1133
|
+
</table>
|
1134
|
+
</div>
|
1135
|
+
|
1136
|
+
<div class="method_details ">
|
1137
|
+
<h3 class="signature " id="device_type-instance_method">
|
1138
|
+
|
1139
|
+
#<strong>device_type</strong>(device_type_id) ⇒ <tt>Object</tt> <span class="extras">(private)</span>
|
1140
|
+
|
1141
|
+
|
1142
|
+
|
1143
|
+
|
1144
|
+
|
1145
|
+
</h3><div class="docstring">
|
1146
|
+
<div class="discussion">
|
1147
|
+
|
1148
|
+
<p>Uses <span class='object_link'><a href="#ary_elem-instance_method" title="MaxCube::Messages#ary_elem (method)">#ary_elem</a></span> with <span class='object_link'><a href="#DEVICE_TYPE-constant" title="MaxCube::Messages::DEVICE_TYPE (constant)">DEVICE_TYPE</a></span></p>
|
1149
|
+
|
1150
|
+
|
1151
|
+
</div>
|
1152
|
+
</div>
|
1153
|
+
<div class="tags">
|
1154
|
+
|
1155
|
+
|
1156
|
+
</div><table class="source_code">
|
1157
|
+
<tr>
|
1158
|
+
<td>
|
1159
|
+
<pre class="lines">
|
1160
|
+
|
1161
|
+
|
1162
|
+
192
|
1163
|
+
193
|
1164
|
+
194</pre>
|
1165
|
+
</td>
|
1166
|
+
<td>
|
1167
|
+
<pre class="code"><span class="info file"># File 'lib/maxcube/messages.rb', line 192</span>
|
1168
|
+
|
1169
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_device_type'>device_type</span><span class='lparen'>(</span><span class='id identifier rubyid_device_type_id'>device_type_id</span><span class='rparen'>)</span>
|
1170
|
+
<span class='id identifier rubyid_ary_elem'>ary_elem</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="#DEVICE_TYPE-constant" title="MaxCube::Messages::DEVICE_TYPE (constant)">DEVICE_TYPE</a></span></span><span class='comma'>,</span> <span class='id identifier rubyid_device_type_id'>device_type_id</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>device type</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
|
1171
|
+
<span class='kw'>end</span></pre>
|
1172
|
+
</td>
|
1173
|
+
</tr>
|
1174
|
+
</table>
|
1175
|
+
</div>
|
1176
|
+
|
1177
|
+
<div class="method_details ">
|
1178
|
+
<h3 class="signature " id="device_type_id-instance_method">
|
1179
|
+
|
1180
|
+
#<strong>device_type_id</strong>(device_type) ⇒ <tt>Object</tt> <span class="extras">(private)</span>
|
1181
|
+
|
1182
|
+
|
1183
|
+
|
1184
|
+
|
1185
|
+
|
1186
|
+
</h3><div class="docstring">
|
1187
|
+
<div class="discussion">
|
1188
|
+
|
1189
|
+
<p>Uses <span class='object_link'><a href="#ary_elem_id-instance_method" title="MaxCube::Messages#ary_elem_id (method)">#ary_elem_id</a></span> with <span class='object_link'><a href="#DEVICE_TYPE-constant" title="MaxCube::Messages::DEVICE_TYPE (constant)">DEVICE_TYPE</a></span></p>
|
1190
|
+
|
1191
|
+
|
1192
|
+
</div>
|
1193
|
+
</div>
|
1194
|
+
<div class="tags">
|
1195
|
+
|
1196
|
+
|
1197
|
+
</div><table class="source_code">
|
1198
|
+
<tr>
|
1199
|
+
<td>
|
1200
|
+
<pre class="lines">
|
1201
|
+
|
1202
|
+
|
1203
|
+
197
|
1204
|
+
198
|
1205
|
+
199</pre>
|
1206
|
+
</td>
|
1207
|
+
<td>
|
1208
|
+
<pre class="code"><span class="info file"># File 'lib/maxcube/messages.rb', line 197</span>
|
1209
|
+
|
1210
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_device_type_id'>device_type_id</span><span class='lparen'>(</span><span class='id identifier rubyid_device_type'>device_type</span><span class='rparen'>)</span>
|
1211
|
+
<span class='id identifier rubyid_ary_elem_id'>ary_elem_id</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="#DEVICE_TYPE-constant" title="MaxCube::Messages::DEVICE_TYPE (constant)">DEVICE_TYPE</a></span></span><span class='comma'>,</span> <span class='id identifier rubyid_device_type'>device_type</span><span class='period'>.</span><span class='id identifier rubyid_to_sym'>to_sym</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>device type</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
|
1212
|
+
<span class='kw'>end</span></pre>
|
1213
|
+
</td>
|
1214
|
+
</tr>
|
1215
|
+
</table>
|
1216
|
+
</div>
|
1217
|
+
|
1218
|
+
<div class="method_details ">
|
1219
|
+
<h3 class="signature " id="to_bool-instance_method">
|
1220
|
+
|
1221
|
+
#<strong>to_bool</strong>(info, arg) ⇒ <tt>Boolean</tt> <span class="extras">(private)</span>
|
1222
|
+
|
1223
|
+
|
1224
|
+
|
1225
|
+
|
1226
|
+
|
1227
|
+
</h3><div class="docstring">
|
1228
|
+
<div class="discussion">
|
1229
|
+
|
1230
|
+
<p>Uses <span class='object_link'><a href="#to_bools-instance_method" title="MaxCube::Messages#to_bools (method)">#to_bools</a></span>, but operates with single argument.</p>
|
1231
|
+
|
1232
|
+
|
1233
|
+
</div>
|
1234
|
+
</div>
|
1235
|
+
<div class="tags">
|
1236
|
+
<p class="tag_title">Parameters:</p>
|
1237
|
+
<ul class="param">
|
1238
|
+
|
1239
|
+
<li>
|
1240
|
+
|
1241
|
+
<span class='name'>arg</span>
|
1242
|
+
|
1243
|
+
|
1244
|
+
<span class='type'></span>
|
1245
|
+
|
1246
|
+
|
1247
|
+
|
1248
|
+
—
|
1249
|
+
<div class='inline'>
|
1250
|
+
<p>argument to convert to bool.</p>
|
1251
|
+
</div>
|
1252
|
+
|
1253
|
+
</li>
|
1254
|
+
|
1255
|
+
</ul>
|
1256
|
+
|
1257
|
+
<p class="tag_title">Returns:</p>
|
1258
|
+
<ul class="return">
|
1259
|
+
|
1260
|
+
<li>
|
1261
|
+
|
1262
|
+
|
1263
|
+
<span class='type'>(<tt>Boolean</tt>)</span>
|
1264
|
+
|
1265
|
+
|
1266
|
+
|
1267
|
+
—
|
1268
|
+
<div class='inline'>
|
1269
|
+
<p>converted element to <code>TrueClass</code> or <code>FalseClass</code>.</p>
|
1270
|
+
</div>
|
1271
|
+
|
1272
|
+
</li>
|
1273
|
+
|
1274
|
+
</ul>
|
1275
|
+
|
1276
|
+
</div><table class="source_code">
|
1277
|
+
<tr>
|
1278
|
+
<td>
|
1279
|
+
<pre class="lines">
|
1280
|
+
|
1281
|
+
|
1282
|
+
139
|
1283
|
+
140
|
1284
|
+
141</pre>
|
1285
|
+
</td>
|
1286
|
+
<td>
|
1287
|
+
<pre class="code"><span class="info file"># File 'lib/maxcube/messages.rb', line 139</span>
|
1288
|
+
|
1289
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_to_bool'>to_bool</span><span class='lparen'>(</span><span class='id identifier rubyid_info'>info</span><span class='comma'>,</span> <span class='id identifier rubyid_arg'>arg</span><span class='rparen'>)</span>
|
1290
|
+
<span class='id identifier rubyid_to_bools'>to_bools</span><span class='lparen'>(</span><span class='id identifier rubyid_info'>info</span><span class='comma'>,</span> <span class='id identifier rubyid_arg'>arg</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_first'>first</span>
|
1291
|
+
<span class='kw'>end</span></pre>
|
1292
|
+
</td>
|
1293
|
+
</tr>
|
1294
|
+
</table>
|
1295
|
+
</div>
|
1296
|
+
|
1297
|
+
<div class="method_details ">
|
1298
|
+
<h3 class="signature " id="to_bools-instance_method">
|
1299
|
+
|
1300
|
+
#<strong>to_bools</strong>(info, *args) ⇒ <tt>Array<Boolean></tt> <span class="extras">(private)</span>
|
1301
|
+
|
1302
|
+
|
1303
|
+
|
1304
|
+
|
1305
|
+
|
1306
|
+
</h3><div class="docstring">
|
1307
|
+
<div class="discussion">
|
1308
|
+
|
1309
|
+
<p>Uses <span class='object_link'><a href="#conv_args-instance_method" title="MaxCube::Messages#conv_args (method)">#conv_args</a></span> to convert objects to bools.</p>
|
1310
|
+
|
1311
|
+
|
1312
|
+
</div>
|
1313
|
+
</div>
|
1314
|
+
<div class="tags">
|
1315
|
+
<p class="tag_title">Parameters:</p>
|
1316
|
+
<ul class="param">
|
1317
|
+
|
1318
|
+
<li>
|
1319
|
+
|
1320
|
+
<span class='name'>args</span>
|
1321
|
+
|
1322
|
+
|
1323
|
+
<span class='type'>(<tt>Array</tt>)</span>
|
1324
|
+
|
1325
|
+
|
1326
|
+
|
1327
|
+
—
|
1328
|
+
<div class='inline'>
|
1329
|
+
<p>arguments to convert to bools.</p>
|
1330
|
+
</div>
|
1331
|
+
|
1332
|
+
</li>
|
1333
|
+
|
1334
|
+
</ul>
|
1335
|
+
|
1336
|
+
<p class="tag_title">Returns:</p>
|
1337
|
+
<ul class="return">
|
1338
|
+
|
1339
|
+
<li>
|
1340
|
+
|
1341
|
+
|
1342
|
+
<span class='type'>(<tt>Array<Boolean></tt>)</span>
|
1343
|
+
|
1344
|
+
|
1345
|
+
|
1346
|
+
—
|
1347
|
+
<div class='inline'>
|
1348
|
+
<p>converted elements to <code>TrueClass</code> or <code>FalseClass</code>.</p>
|
1349
|
+
</div>
|
1350
|
+
|
1351
|
+
</li>
|
1352
|
+
|
1353
|
+
</ul>
|
1354
|
+
|
1355
|
+
</div><table class="source_code">
|
1356
|
+
<tr>
|
1357
|
+
<td>
|
1358
|
+
<pre class="lines">
|
1359
|
+
|
1360
|
+
|
1361
|
+
121
|
1362
|
+
122
|
1363
|
+
123
|
1364
|
+
124
|
1365
|
+
125
|
1366
|
+
126
|
1367
|
+
127
|
1368
|
+
128
|
1369
|
+
129
|
1370
|
+
130
|
1371
|
+
131
|
1372
|
+
132
|
1373
|
+
133</pre>
|
1374
|
+
</td>
|
1375
|
+
<td>
|
1376
|
+
<pre class="code"><span class="info file"># File 'lib/maxcube/messages.rb', line 121</span>
|
1377
|
+
|
1378
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_to_bools'>to_bools</span><span class='lparen'>(</span><span class='id identifier rubyid_info'>info</span><span class='comma'>,</span> <span class='op'>*</span><span class='id identifier rubyid_args'>args</span><span class='rparen'>)</span>
|
1379
|
+
<span class='id identifier rubyid_conv_args'>conv_args</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>boolean</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='id identifier rubyid_info'>info</span><span class='comma'>,</span> <span class='op'>*</span><span class='id identifier rubyid_args'>args</span><span class='rparen'>)</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_arg'>arg</span><span class='op'>|</span>
|
1380
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_arg'>arg</span> <span class='op'>==</span> <span class='op'>!</span><span class='op'>!</span><span class='id identifier rubyid_arg'>arg</span>
|
1381
|
+
<span class='id identifier rubyid_arg'>arg</span>
|
1382
|
+
<span class='kw'>elsif</span> <span class='id identifier rubyid_arg'>arg</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
|
1383
|
+
<span class='kw'>false</span>
|
1384
|
+
<span class='kw'>elsif</span> <span class='qwords_beg'>%w[</span><span class='tstring_content'>true</span><span class='words_sep'> </span><span class='tstring_content'>false</span><span class='tstring_end'>]</span></span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span><span class='lparen'>(</span><span class='id identifier rubyid_arg'>arg</span><span class='rparen'>)</span>
|
1385
|
+
<span class='id identifier rubyid_arg'>arg</span> <span class='op'>==</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>true</span><span class='tstring_end'>'</span></span>
|
1386
|
+
<span class='kw'>else</span>
|
1387
|
+
<span class='op'>!</span><span class='const'>Integer</span><span class='lparen'>(</span><span class='id identifier rubyid_arg'>arg</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_zero?'>zero?</span>
|
1388
|
+
<span class='kw'>end</span>
|
1389
|
+
<span class='kw'>end</span>
|
1390
|
+
<span class='kw'>end</span></pre>
|
1391
|
+
</td>
|
1392
|
+
</tr>
|
1393
|
+
</table>
|
1394
|
+
</div>
|
1395
|
+
|
1396
|
+
<div class="method_details ">
|
1397
|
+
<h3 class="signature " id="to_datetime-instance_method">
|
1398
|
+
|
1399
|
+
#<strong>to_datetime</strong>(info, arg) ⇒ <tt>Time</tt> <span class="extras">(private)</span>
|
1400
|
+
|
1401
|
+
|
1402
|
+
|
1403
|
+
|
1404
|
+
|
1405
|
+
</h3><div class="docstring">
|
1406
|
+
<div class="discussion">
|
1407
|
+
|
1408
|
+
<p>Uses <span class='object_link'><a href="#to_datetime-instance_method" title="MaxCube::Messages#to_datetime (method)">#to_datetime</a></span>, but operates with single argument.</p>
|
1409
|
+
|
1410
|
+
|
1411
|
+
</div>
|
1412
|
+
</div>
|
1413
|
+
<div class="tags">
|
1414
|
+
<p class="tag_title">Parameters:</p>
|
1415
|
+
<ul class="param">
|
1416
|
+
|
1417
|
+
<li>
|
1418
|
+
|
1419
|
+
<span class='name'>arg</span>
|
1420
|
+
|
1421
|
+
|
1422
|
+
<span class='type'></span>
|
1423
|
+
|
1424
|
+
|
1425
|
+
|
1426
|
+
—
|
1427
|
+
<div class='inline'>
|
1428
|
+
<p>argument to convert to <code>Time</code>.</p>
|
1429
|
+
</div>
|
1430
|
+
|
1431
|
+
</li>
|
1432
|
+
|
1433
|
+
</ul>
|
1434
|
+
|
1435
|
+
<p class="tag_title">Returns:</p>
|
1436
|
+
<ul class="return">
|
1437
|
+
|
1438
|
+
<li>
|
1439
|
+
|
1440
|
+
|
1441
|
+
<span class='type'>(<tt>Time</tt>)</span>
|
1442
|
+
|
1443
|
+
|
1444
|
+
|
1445
|
+
—
|
1446
|
+
<div class='inline'>
|
1447
|
+
<p>converted element.</p>
|
1448
|
+
</div>
|
1449
|
+
|
1450
|
+
</li>
|
1451
|
+
|
1452
|
+
</ul>
|
1453
|
+
|
1454
|
+
</div><table class="source_code">
|
1455
|
+
<tr>
|
1456
|
+
<td>
|
1457
|
+
<pre class="lines">
|
1458
|
+
|
1459
|
+
|
1460
|
+
165
|
1461
|
+
166
|
1462
|
+
167</pre>
|
1463
|
+
</td>
|
1464
|
+
<td>
|
1465
|
+
<pre class="code"><span class="info file"># File 'lib/maxcube/messages.rb', line 165</span>
|
1466
|
+
|
1467
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_to_datetime'>to_datetime</span><span class='lparen'>(</span><span class='id identifier rubyid_info'>info</span><span class='comma'>,</span> <span class='id identifier rubyid_arg'>arg</span><span class='rparen'>)</span>
|
1468
|
+
<span class='id identifier rubyid_to_datetimes'>to_datetimes</span><span class='lparen'>(</span><span class='id identifier rubyid_info'>info</span><span class='comma'>,</span> <span class='id identifier rubyid_arg'>arg</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_first'>first</span>
|
1469
|
+
<span class='kw'>end</span></pre>
|
1470
|
+
</td>
|
1471
|
+
</tr>
|
1472
|
+
</table>
|
1473
|
+
</div>
|
1474
|
+
|
1475
|
+
<div class="method_details ">
|
1476
|
+
<h3 class="signature " id="to_datetimes-instance_method">
|
1477
|
+
|
1478
|
+
#<strong>to_datetimes</strong>(info, *args) ⇒ <tt>Array<Time></tt> <span class="extras">(private)</span>
|
1479
|
+
|
1480
|
+
|
1481
|
+
|
1482
|
+
|
1483
|
+
|
1484
|
+
</h3><div class="docstring">
|
1485
|
+
<div class="discussion">
|
1486
|
+
|
1487
|
+
<p>Uses <span class='object_link'><a href="#conv_args-instance_method" title="MaxCube::Messages#conv_args (method)">#conv_args</a></span> to convert objects to <code>Time</code>.</p>
|
1488
|
+
|
1489
|
+
|
1490
|
+
</div>
|
1491
|
+
</div>
|
1492
|
+
<div class="tags">
|
1493
|
+
<p class="tag_title">Parameters:</p>
|
1494
|
+
<ul class="param">
|
1495
|
+
|
1496
|
+
<li>
|
1497
|
+
|
1498
|
+
<span class='name'>args</span>
|
1499
|
+
|
1500
|
+
|
1501
|
+
<span class='type'>(<tt>Array</tt>)</span>
|
1502
|
+
|
1503
|
+
|
1504
|
+
|
1505
|
+
—
|
1506
|
+
<div class='inline'>
|
1507
|
+
<p>arguments to convert to <code>Time</code>.</p>
|
1508
|
+
</div>
|
1509
|
+
|
1510
|
+
</li>
|
1511
|
+
|
1512
|
+
</ul>
|
1513
|
+
|
1514
|
+
<p class="tag_title">Returns:</p>
|
1515
|
+
<ul class="return">
|
1516
|
+
|
1517
|
+
<li>
|
1518
|
+
|
1519
|
+
|
1520
|
+
<span class='type'>(<tt>Array<Time></tt>)</span>
|
1521
|
+
|
1522
|
+
|
1523
|
+
|
1524
|
+
—
|
1525
|
+
<div class='inline'>
|
1526
|
+
<p>converted elements.</p>
|
1527
|
+
</div>
|
1528
|
+
|
1529
|
+
</li>
|
1530
|
+
|
1531
|
+
</ul>
|
1532
|
+
|
1533
|
+
</div><table class="source_code">
|
1534
|
+
<tr>
|
1535
|
+
<td>
|
1536
|
+
<pre class="lines">
|
1537
|
+
|
1538
|
+
|
1539
|
+
146
|
1540
|
+
147
|
1541
|
+
148
|
1542
|
+
149
|
1543
|
+
150
|
1544
|
+
151
|
1545
|
+
152
|
1546
|
+
153
|
1547
|
+
154
|
1548
|
+
155
|
1549
|
+
156
|
1550
|
+
157
|
1551
|
+
158
|
1552
|
+
159
|
1553
|
+
160</pre>
|
1554
|
+
</td>
|
1555
|
+
<td>
|
1556
|
+
<pre class="code"><span class="info file"># File 'lib/maxcube/messages.rb', line 146</span>
|
1557
|
+
|
1558
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_to_datetimes'>to_datetimes</span><span class='lparen'>(</span><span class='id identifier rubyid_info'>info</span><span class='comma'>,</span> <span class='op'>*</span><span class='id identifier rubyid_args'>args</span><span class='rparen'>)</span>
|
1559
|
+
<span class='id identifier rubyid_conv_args'>conv_args</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>datetime</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='id identifier rubyid_info'>info</span><span class='comma'>,</span> <span class='op'>*</span><span class='id identifier rubyid_args'>args</span><span class='rparen'>)</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_arg'>arg</span><span class='op'>|</span>
|
1560
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_arg'>arg</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>Time</span><span class='rparen'>)</span>
|
1561
|
+
<span class='id identifier rubyid_arg'>arg</span>
|
1562
|
+
<span class='kw'>elsif</span> <span class='id identifier rubyid_arg'>arg</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>String</span><span class='rparen'>)</span>
|
1563
|
+
<span class='const'>Time</span><span class='period'>.</span><span class='id identifier rubyid_parse'>parse</span><span class='lparen'>(</span><span class='id identifier rubyid_arg'>arg</span><span class='rparen'>)</span>
|
1564
|
+
<span class='kw'>elsif</span> <span class='id identifier rubyid_arg'>arg</span><span class='period'>.</span><span class='id identifier rubyid_respond_to?'>respond_to?</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>to_time</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
|
1565
|
+
<span class='id identifier rubyid_arg'>arg</span><span class='period'>.</span><span class='id identifier rubyid_to_time'>to_time</span>
|
1566
|
+
<span class='kw'>elsif</span> <span class='id identifier rubyid_arg'>arg</span><span class='period'>.</span><span class='id identifier rubyid_respond_to?'>respond_to?</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>to_date</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
|
1567
|
+
<span class='id identifier rubyid_arg'>arg</span><span class='period'>.</span><span class='id identifier rubyid_to_date'>to_date</span><span class='period'>.</span><span class='id identifier rubyid_to_time'>to_time</span>
|
1568
|
+
<span class='kw'>else</span>
|
1569
|
+
<span class='id identifier rubyid_raise'>raise</span> <span class='const'>ArgumentError</span>
|
1570
|
+
<span class='kw'>end</span>
|
1571
|
+
<span class='kw'>end</span>
|
1572
|
+
<span class='kw'>end</span></pre>
|
1573
|
+
</td>
|
1574
|
+
</tr>
|
1575
|
+
</table>
|
1576
|
+
</div>
|
1577
|
+
|
1578
|
+
<div class="method_details ">
|
1579
|
+
<h3 class="signature " id="to_float-instance_method">
|
1580
|
+
|
1581
|
+
#<strong>to_float</strong>(info, arg) ⇒ <tt>Float</tt> <span class="extras">(private)</span>
|
1582
|
+
|
1583
|
+
|
1584
|
+
|
1585
|
+
|
1586
|
+
|
1587
|
+
</h3><div class="docstring">
|
1588
|
+
<div class="discussion">
|
1589
|
+
|
1590
|
+
<p>Uses <span class='object_link'><a href="#to_floats-instance_method" title="MaxCube::Messages#to_floats (method)">#to_floats</a></span>, but operates with single argument.</p>
|
1591
|
+
|
1592
|
+
|
1593
|
+
</div>
|
1594
|
+
</div>
|
1595
|
+
<div class="tags">
|
1596
|
+
<p class="tag_title">Parameters:</p>
|
1597
|
+
<ul class="param">
|
1598
|
+
|
1599
|
+
<li>
|
1600
|
+
|
1601
|
+
<span class='name'>arg</span>
|
1602
|
+
|
1603
|
+
|
1604
|
+
<span class='type'>(<tt>#Float</tt>)</span>
|
1605
|
+
|
1606
|
+
|
1607
|
+
|
1608
|
+
—
|
1609
|
+
<div class='inline'>
|
1610
|
+
<p>argument to convert to float.</p>
|
1611
|
+
</div>
|
1612
|
+
|
1613
|
+
</li>
|
1614
|
+
|
1615
|
+
</ul>
|
1616
|
+
|
1617
|
+
<p class="tag_title">Returns:</p>
|
1618
|
+
<ul class="return">
|
1619
|
+
|
1620
|
+
<li>
|
1621
|
+
|
1622
|
+
|
1623
|
+
<span class='type'>(<tt>Float</tt>)</span>
|
1624
|
+
|
1625
|
+
|
1626
|
+
|
1627
|
+
—
|
1628
|
+
<div class='inline'>
|
1629
|
+
<p>converted element.</p>
|
1630
|
+
</div>
|
1631
|
+
|
1632
|
+
</li>
|
1633
|
+
|
1634
|
+
</ul>
|
1635
|
+
|
1636
|
+
</div><table class="source_code">
|
1637
|
+
<tr>
|
1638
|
+
<td>
|
1639
|
+
<pre class="lines">
|
1640
|
+
|
1641
|
+
|
1642
|
+
113
|
1643
|
+
114
|
1644
|
+
115</pre>
|
1645
|
+
</td>
|
1646
|
+
<td>
|
1647
|
+
<pre class="code"><span class="info file"># File 'lib/maxcube/messages.rb', line 113</span>
|
1648
|
+
|
1649
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_to_float'>to_float</span><span class='lparen'>(</span><span class='id identifier rubyid_info'>info</span><span class='comma'>,</span> <span class='id identifier rubyid_arg'>arg</span><span class='rparen'>)</span>
|
1650
|
+
<span class='id identifier rubyid_to_floats'>to_floats</span><span class='lparen'>(</span><span class='id identifier rubyid_info'>info</span><span class='comma'>,</span> <span class='id identifier rubyid_arg'>arg</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_first'>first</span>
|
1651
|
+
<span class='kw'>end</span></pre>
|
1652
|
+
</td>
|
1653
|
+
</tr>
|
1654
|
+
</table>
|
1655
|
+
</div>
|
1656
|
+
|
1657
|
+
<div class="method_details ">
|
1658
|
+
<h3 class="signature " id="to_floats-instance_method">
|
1659
|
+
|
1660
|
+
#<strong>to_floats</strong>(info, *args) ⇒ <tt>Array<Float></tt> <span class="extras">(private)</span>
|
1661
|
+
|
1662
|
+
|
1663
|
+
|
1664
|
+
|
1665
|
+
|
1666
|
+
</h3><div class="docstring">
|
1667
|
+
<div class="discussion">
|
1668
|
+
|
1669
|
+
<p>Uses <span class='object_link'><a href="#conv_args-instance_method" title="MaxCube::Messages#conv_args (method)">#conv_args</a></span> to convert numbers or string of characters (not binary
|
1670
|
+
data!) to floats.</p>
|
1671
|
+
|
1672
|
+
|
1673
|
+
</div>
|
1674
|
+
</div>
|
1675
|
+
<div class="tags">
|
1676
|
+
<p class="tag_title">Parameters:</p>
|
1677
|
+
<ul class="param">
|
1678
|
+
|
1679
|
+
<li>
|
1680
|
+
|
1681
|
+
<span class='name'>args</span>
|
1682
|
+
|
1683
|
+
|
1684
|
+
<span class='type'>(<tt>Array<#Float></tt>)</span>
|
1685
|
+
|
1686
|
+
|
1687
|
+
|
1688
|
+
—
|
1689
|
+
<div class='inline'>
|
1690
|
+
<p>arguments to convert to floats.</p>
|
1691
|
+
</div>
|
1692
|
+
|
1693
|
+
</li>
|
1694
|
+
|
1695
|
+
</ul>
|
1696
|
+
|
1697
|
+
<p class="tag_title">Returns:</p>
|
1698
|
+
<ul class="return">
|
1699
|
+
|
1700
|
+
<li>
|
1701
|
+
|
1702
|
+
|
1703
|
+
<span class='type'>(<tt>Array<Float></tt>)</span>
|
1704
|
+
|
1705
|
+
|
1706
|
+
|
1707
|
+
—
|
1708
|
+
<div class='inline'>
|
1709
|
+
<p>converted elements.</p>
|
1710
|
+
</div>
|
1711
|
+
|
1712
|
+
</li>
|
1713
|
+
|
1714
|
+
</ul>
|
1715
|
+
|
1716
|
+
</div><table class="source_code">
|
1717
|
+
<tr>
|
1718
|
+
<td>
|
1719
|
+
<pre class="lines">
|
1720
|
+
|
1721
|
+
|
1722
|
+
106
|
1723
|
+
107
|
1724
|
+
108</pre>
|
1725
|
+
</td>
|
1726
|
+
<td>
|
1727
|
+
<pre class="code"><span class="info file"># File 'lib/maxcube/messages.rb', line 106</span>
|
1728
|
+
|
1729
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_to_floats'>to_floats</span><span class='lparen'>(</span><span class='id identifier rubyid_info'>info</span><span class='comma'>,</span> <span class='op'>*</span><span class='id identifier rubyid_args'>args</span><span class='rparen'>)</span>
|
1730
|
+
<span class='id identifier rubyid_conv_args'>conv_args</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>float</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='id identifier rubyid_info'>info</span><span class='comma'>,</span> <span class='op'>*</span><span class='id identifier rubyid_args'>args</span><span class='rparen'>)</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_x'>x</span><span class='op'>|</span> <span class='const'>Float</span><span class='lparen'>(</span><span class='id identifier rubyid_x'>x</span><span class='rparen'>)</span> <span class='rbrace'>}</span>
|
1731
|
+
<span class='kw'>end</span></pre>
|
1732
|
+
</td>
|
1733
|
+
</tr>
|
1734
|
+
</table>
|
1735
|
+
</div>
|
1736
|
+
|
1737
|
+
<div class="method_details ">
|
1738
|
+
<h3 class="signature " id="to_int-instance_method">
|
1739
|
+
|
1740
|
+
#<strong>to_int</strong>(base, info, arg) ⇒ <tt>Integer</tt> <span class="extras">(private)</span>
|
1741
|
+
|
1742
|
+
|
1743
|
+
|
1744
|
+
|
1745
|
+
|
1746
|
+
</h3><div class="docstring">
|
1747
|
+
<div class="discussion">
|
1748
|
+
|
1749
|
+
<p>Uses <span class='object_link'><a href="#to_ints-instance_method" title="MaxCube::Messages#to_ints (method)">#to_ints</a></span>, but operates with single argument.</p>
|
1750
|
+
|
1751
|
+
|
1752
|
+
</div>
|
1753
|
+
</div>
|
1754
|
+
<div class="tags">
|
1755
|
+
<p class="tag_title">Parameters:</p>
|
1756
|
+
<ul class="param">
|
1757
|
+
|
1758
|
+
<li>
|
1759
|
+
|
1760
|
+
<span class='name'>arg</span>
|
1761
|
+
|
1762
|
+
|
1763
|
+
<span class='type'>(<tt>#Integer</tt>)</span>
|
1764
|
+
|
1765
|
+
|
1766
|
+
|
1767
|
+
—
|
1768
|
+
<div class='inline'>
|
1769
|
+
<p>argument to convert to integer.</p>
|
1770
|
+
</div>
|
1771
|
+
|
1772
|
+
</li>
|
1773
|
+
|
1774
|
+
</ul>
|
1775
|
+
|
1776
|
+
<p class="tag_title">Returns:</p>
|
1777
|
+
<ul class="return">
|
1778
|
+
|
1779
|
+
<li>
|
1780
|
+
|
1781
|
+
|
1782
|
+
<span class='type'>(<tt>Integer</tt>)</span>
|
1783
|
+
|
1784
|
+
|
1785
|
+
|
1786
|
+
—
|
1787
|
+
<div class='inline'>
|
1788
|
+
<p>converted element.</p>
|
1789
|
+
</div>
|
1790
|
+
|
1791
|
+
</li>
|
1792
|
+
|
1793
|
+
</ul>
|
1794
|
+
|
1795
|
+
</div><table class="source_code">
|
1796
|
+
<tr>
|
1797
|
+
<td>
|
1798
|
+
<pre class="lines">
|
1799
|
+
|
1800
|
+
|
1801
|
+
98
|
1802
|
+
99
|
1803
|
+
100</pre>
|
1804
|
+
</td>
|
1805
|
+
<td>
|
1806
|
+
<pre class="code"><span class="info file"># File 'lib/maxcube/messages.rb', line 98</span>
|
1807
|
+
|
1808
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_to_int'>to_int</span><span class='lparen'>(</span><span class='id identifier rubyid_base'>base</span><span class='comma'>,</span> <span class='id identifier rubyid_info'>info</span><span class='comma'>,</span> <span class='id identifier rubyid_arg'>arg</span><span class='rparen'>)</span>
|
1809
|
+
<span class='id identifier rubyid_to_ints'>to_ints</span><span class='lparen'>(</span><span class='id identifier rubyid_base'>base</span><span class='comma'>,</span> <span class='id identifier rubyid_info'>info</span><span class='comma'>,</span> <span class='id identifier rubyid_arg'>arg</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_first'>first</span>
|
1810
|
+
<span class='kw'>end</span></pre>
|
1811
|
+
</td>
|
1812
|
+
</tr>
|
1813
|
+
</table>
|
1814
|
+
</div>
|
1815
|
+
|
1816
|
+
<div class="method_details ">
|
1817
|
+
<h3 class="signature " id="to_ints-instance_method">
|
1818
|
+
|
1819
|
+
#<strong>to_ints</strong>(base, info, *args) ⇒ <tt>Array<Integer></tt> <span class="extras">(private)</span>
|
1820
|
+
|
1821
|
+
|
1822
|
+
|
1823
|
+
|
1824
|
+
|
1825
|
+
</h3><div class="docstring">
|
1826
|
+
<div class="discussion">
|
1827
|
+
|
1828
|
+
<p>Uses <span class='object_link'><a href="#conv_args-instance_method" title="MaxCube::Messages#conv_args (method)">#conv_args</a></span> to convert numbers or string of characters (not binary
|
1829
|
+
data!) to integers in given base (radix). For binary data use
|
1830
|
+
<span class='object_link'><a href="Messages/Parser.html#read-instance_method" title="MaxCube::Messages::Parser#read (method)">MaxCube::Messages::Parser#read</a></span>.</p>
|
1831
|
+
|
1832
|
+
|
1833
|
+
</div>
|
1834
|
+
</div>
|
1835
|
+
<div class="tags">
|
1836
|
+
<p class="tag_title">Parameters:</p>
|
1837
|
+
<ul class="param">
|
1838
|
+
|
1839
|
+
<li>
|
1840
|
+
|
1841
|
+
<span class='name'>base</span>
|
1842
|
+
|
1843
|
+
|
1844
|
+
<span class='type'>(<tt>Integer</tt>)</span>
|
1845
|
+
|
1846
|
+
|
1847
|
+
|
1848
|
+
—
|
1849
|
+
<div class='inline'>
|
1850
|
+
<p>integers base (radix), 0 means auto-recognition.</p>
|
1851
|
+
</div>
|
1852
|
+
|
1853
|
+
</li>
|
1854
|
+
|
1855
|
+
<li>
|
1856
|
+
|
1857
|
+
<span class='name'>args</span>
|
1858
|
+
|
1859
|
+
|
1860
|
+
<span class='type'>(<tt>Array<#Integer></tt>)</span>
|
1861
|
+
|
1862
|
+
|
1863
|
+
|
1864
|
+
—
|
1865
|
+
<div class='inline'>
|
1866
|
+
<p>arguments to convert to integers.</p>
|
1867
|
+
</div>
|
1868
|
+
|
1869
|
+
</li>
|
1870
|
+
|
1871
|
+
</ul>
|
1872
|
+
|
1873
|
+
<p class="tag_title">Returns:</p>
|
1874
|
+
<ul class="return">
|
1875
|
+
|
1876
|
+
<li>
|
1877
|
+
|
1878
|
+
|
1879
|
+
<span class='type'>(<tt>Array<Integer></tt>)</span>
|
1880
|
+
|
1881
|
+
|
1882
|
+
|
1883
|
+
—
|
1884
|
+
<div class='inline'>
|
1885
|
+
<p>converted elements.</p>
|
1886
|
+
</div>
|
1887
|
+
|
1888
|
+
</li>
|
1889
|
+
|
1890
|
+
</ul>
|
1891
|
+
|
1892
|
+
</div><table class="source_code">
|
1893
|
+
<tr>
|
1894
|
+
<td>
|
1895
|
+
<pre class="lines">
|
1896
|
+
|
1897
|
+
|
1898
|
+
90
|
1899
|
+
91
|
1900
|
+
92
|
1901
|
+
93</pre>
|
1902
|
+
</td>
|
1903
|
+
<td>
|
1904
|
+
<pre class="code"><span class="info file"># File 'lib/maxcube/messages.rb', line 90</span>
|
1905
|
+
|
1906
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_to_ints'>to_ints</span><span class='lparen'>(</span><span class='id identifier rubyid_base'>base</span><span class='comma'>,</span> <span class='id identifier rubyid_info'>info</span><span class='comma'>,</span> <span class='op'>*</span><span class='id identifier rubyid_args'>args</span><span class='rparen'>)</span>
|
1907
|
+
<span class='id identifier rubyid_base_str'>base_str</span> <span class='op'>=</span> <span class='id identifier rubyid_base'>base</span><span class='period'>.</span><span class='id identifier rubyid_zero?'>zero?</span> <span class='op'>?</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_end'>'</span></span> <span class='op'>:</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>(</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_base'>base</span><span class='embexpr_end'>}</span><span class='tstring_content'>)</span><span class='tstring_end'>"</span></span>
|
1908
|
+
<span class='id identifier rubyid_conv_args'>conv_args</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>integer</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_base_str'>base_str</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='id identifier rubyid_info'>info</span><span class='comma'>,</span> <span class='op'>*</span><span class='id identifier rubyid_args'>args</span><span class='rparen'>)</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_x'>x</span><span class='op'>|</span> <span class='const'>Integer</span><span class='lparen'>(</span><span class='id identifier rubyid_x'>x</span><span class='comma'>,</span> <span class='id identifier rubyid_base'>base</span><span class='rparen'>)</span> <span class='rbrace'>}</span>
|
1909
|
+
<span class='kw'>end</span></pre>
|
1910
|
+
</td>
|
1911
|
+
</tr>
|
1912
|
+
</table>
|
1913
|
+
</div>
|
1914
|
+
|
1915
|
+
</div>
|
1916
|
+
|
1917
|
+
</div>
|
1918
|
+
|
1919
|
+
<div id="footer">
|
1920
|
+
Generated on Fri Feb 16 13:44:01 2018 by
|
1921
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
1922
|
+
0.9.12 (ruby-2.5.0).
|
1923
|
+
</div>
|
1924
|
+
|
1925
|
+
</div>
|
1926
|
+
</body>
|
1927
|
+
</html>
|