raspberry_pi_iot 0.0.8 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (109) hide show
  1. checksums.yaml +5 -5
  2. data/doc/IoT.html +8 -6
  3. data/doc/{Bus.html → RaspberryPiIoT.html} +21 -26
  4. data/doc/_index.html +84 -77
  5. data/doc/class_list.html +1 -1
  6. data/doc/file.LICENSE.html +92 -0
  7. data/doc/file.README.html +63 -29
  8. data/doc/file_list.html +5 -0
  9. data/doc/frames.html +1 -1
  10. data/doc/index.html +63 -29
  11. data/doc/method_list.html +170 -202
  12. data/doc/top-level-namespace.html +4 -6
  13. data/lib/bus.rb +0 -2
  14. data/lib/iot.rb +4 -2
  15. data/lib/iot/actuator.rb +7 -0
  16. data/lib/iot/bh1750.rb +54 -0
  17. data/lib/iot/binary_actuator.rb +7 -0
  18. data/lib/iot/binary_effector.rb +11 -0
  19. data/lib/iot/binary_receptor.rb +20 -0
  20. data/lib/iot/binary_sensor.rb +7 -0
  21. data/lib/iot/bmx_sensor.rb +73 -0
  22. data/lib/iot/button.rb +100 -0
  23. data/lib/iot/dht_sensor.rb +41 -0
  24. data/lib/iot/digital_actuator.rb +7 -0
  25. data/lib/iot/digital_effector.rb +67 -0
  26. data/lib/iot/digital_receptor.rb +17 -0
  27. data/lib/iot/digital_sensor.rb +7 -0
  28. data/lib/iot/ds18b20.rb +25 -0
  29. data/lib/iot/effector.rb +32 -0
  30. data/lib/iot/hcsr501.rb +8 -0
  31. data/lib/iot/humiture_sensor.rb +27 -0
  32. data/lib/iot/led.rb +64 -0
  33. data/lib/iot/led_pwm.rb +8 -0
  34. data/lib/iot/led_rgb.rb +86 -0
  35. data/lib/iot/max44009.rb +84 -0
  36. data/lib/iot/receptor.rb +38 -0
  37. data/lib/iot/sensor.rb +8 -0
  38. data/lib/iot/temperature_sensor.rb +51 -0
  39. data/lib/raspberry_pi.rb +46 -1
  40. data/lib/raspberry_pi_iot.rb +9 -3
  41. data/lib/raspberry_pi_iot/version.rb +3 -0
  42. data/lib/thermal_sensor.rb +2 -3
  43. data/test/test.sh +17 -0
  44. data/test/test.txt +173 -0
  45. data/test/test_Raspberry_Pi_IoT.rb +10 -0
  46. data/test/test_bh1750.rb +9 -4
  47. data/test/{standalone_test_bmp280.rb → test_bme280.rb} +24 -19
  48. data/test/test_bmp280.rb +52 -0
  49. data/test/test_button.rb +25 -14
  50. data/test/test_dht11.rb +3 -3
  51. data/test/test_dht22.rb +35 -0
  52. data/test/test_ds18b20.rb +4 -3
  53. data/test/test_helper.rb +6 -0
  54. data/test/test_info.rb +24 -3
  55. data/test/test_ky008.rb +41 -0
  56. data/test/test_led.rb +9 -9
  57. data/test/test_led_rgb.rb +28 -5
  58. data/test/test_max44009_gy49.rb +4 -4
  59. data/test/test_thermal.rb +27 -0
  60. metadata +103 -59
  61. data/doc/Actuator.html +0 -145
  62. data/doc/BH1750.html +0 -541
  63. data/doc/BME280.html +0 -276
  64. data/doc/BMP280.html +0 -276
  65. data/doc/BMxSensor.html +0 -557
  66. data/doc/BinaryActuator.html +0 -177
  67. data/doc/BinaryEffector.html +0 -246
  68. data/doc/BinaryReceptor.html +0 -387
  69. data/doc/BinarySensor.html +0 -168
  70. data/doc/Button.html +0 -986
  71. data/doc/DHT11.html +0 -287
  72. data/doc/DHT22.html +0 -287
  73. data/doc/DHTxxSensor.html +0 -361
  74. data/doc/DS18B20.html +0 -339
  75. data/doc/DigitalActuator.html +0 -164
  76. data/doc/DigitalEffector.html +0 -636
  77. data/doc/DigitalReceptor.html +0 -242
  78. data/doc/DigitalSensor.html +0 -162
  79. data/doc/Effector.html +0 -257
  80. data/doc/HCSR501.html +0 -172
  81. data/doc/HumitureSensor.html +0 -453
  82. data/doc/LED.html +0 -784
  83. data/doc/MAX44009.html +0 -830
  84. data/doc/RaspberryPi.html +0 -317
  85. data/doc/Receptor.html +0 -257
  86. data/doc/Sensor.html +0 -145
  87. data/doc/TemperatureSensor.html +0 -644
  88. data/lib/bh1750.rb +0 -46
  89. data/lib/binary_actuator.rb +0 -5
  90. data/lib/binary_effector.rb +0 -12
  91. data/lib/binary_receptor.rb +0 -19
  92. data/lib/binary_sensor.rb +0 -5
  93. data/lib/bmx_sensor.rb +0 -85
  94. data/lib/button.rb +0 -70
  95. data/lib/dht_sensor.rb +0 -36
  96. data/lib/digital_actuator.rb +0 -5
  97. data/lib/digital_effector.rb +0 -69
  98. data/lib/digital_receptor.rb +0 -16
  99. data/lib/digital_sensor.rb +0 -5
  100. data/lib/ds18b20.rb +0 -24
  101. data/lib/effector.rb +0 -32
  102. data/lib/hcsr501.rb +0 -7
  103. data/lib/humiture_sensor.rb +0 -26
  104. data/lib/led.rb +0 -58
  105. data/lib/led_pwm.rb +0 -6
  106. data/lib/led_rgb.rb +0 -101
  107. data/lib/max44009.rb +0 -77
  108. data/lib/receptor.rb +0 -33
  109. data/lib/temperature_sensor.rb +0 -49
@@ -1,168 +0,0 @@
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: BinarySensor
8
-
9
- &mdash; Documentation by YARD 0.9.16
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 = "BinarySensor";
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 (B)</a> &raquo;
40
-
41
-
42
- <span class="title">BinarySensor</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: BinarySensor
63
-
64
-
65
-
66
- </h1>
67
- <div class="box_info">
68
-
69
- <dl>
70
- <dt>Inherits:</dt>
71
- <dd>
72
- <span class="inheritName"><span class='object_link'><a href="BinaryReceptor.html" title="BinaryReceptor (class)">BinaryReceptor</a></span></span>
73
-
74
- <ul class="fullTree">
75
- <li>Object</li>
76
-
77
- <li class="next"><span class='object_link'><a href="Receptor.html" title="Receptor (class)">Receptor</a></span></li>
78
-
79
- <li class="next"><span class='object_link'><a href="BinaryReceptor.html" title="BinaryReceptor (class)">BinaryReceptor</a></span></li>
80
-
81
- <li class="next">BinarySensor</li>
82
-
83
- </ul>
84
- <a href="#" class="inheritanceTree">show all</a>
85
-
86
- </dd>
87
- </dl>
88
-
89
-
90
-
91
-
92
-
93
-
94
-
95
-
96
-
97
-
98
-
99
- <dl>
100
- <dt>Defined in:</dt>
101
- <dd>lib/binary_sensor.rb</dd>
102
- </dl>
103
-
104
- </div>
105
-
106
- <h2>Overview</h2><div class="docstring">
107
- <div class="discussion">
108
-
109
- <p>BinarySensor - a synonym for BinaryReceptor</p>
110
-
111
-
112
- </div>
113
- </div>
114
- <div class="tags">
115
-
116
-
117
- </div><div id="subclasses">
118
- <h2>Direct Known Subclasses</h2>
119
- <p class="children"><span class='object_link'><a href="HCSR501.html" title="HCSR501 (class)">HCSR501</a></span></p>
120
- </div>
121
-
122
-
123
-
124
-
125
-
126
-
127
-
128
-
129
-
130
-
131
-
132
-
133
-
134
-
135
- <h2>Method Summary</h2>
136
-
137
- <h3 class="inherited">Methods inherited from <span class='object_link'><a href="BinaryReceptor.html" title="BinaryReceptor (class)">BinaryReceptor</a></span></h3>
138
- <p class="inherited"><span class='object_link'><a href="BinaryReceptor.html#high%3F-instance_method" title="BinaryReceptor#high? (method)">#high?</a></span>, <span class='object_link'><a href="BinaryReceptor.html#initialize-instance_method" title="BinaryReceptor#initialize (method)">#initialize</a></span>, <span class='object_link'><a href="BinaryReceptor.html#low%3F-instance_method" title="BinaryReceptor#low? (method)">#low?</a></span></p>
139
-
140
-
141
-
142
-
143
-
144
-
145
-
146
-
147
-
148
- <h3 class="inherited">Methods inherited from <span class='object_link'><a href="Receptor.html" title="Receptor (class)">Receptor</a></span></h3>
149
- <p class="inherited"><span class='object_link'><a href="Receptor.html#model_name-instance_method" title="Receptor#model_name (method)">#model_name</a></span>, <span class='object_link'><a href="Receptor.html#name-instance_method" title="Receptor#name (method)">#name</a></span></p>
150
- <div id="constructor_details" class="method_details_list">
151
- <h2>Constructor Details</h2>
152
-
153
- <p class="notice">This class inherits a constructor from <span class='object_link'><a href="BinaryReceptor.html#initialize-instance_method" title="BinaryReceptor#initialize (method)">BinaryReceptor</a></span></p>
154
-
155
- </div>
156
-
157
-
158
- </div>
159
-
160
- <div id="footer">
161
- Generated on Tue Dec 18 16:03:39 2018 by
162
- <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
163
- 0.9.16 (ruby-2.3.3).
164
- </div>
165
-
166
- </div>
167
- </body>
168
- </html>
@@ -1,986 +0,0 @@
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: Button
8
-
9
- &mdash; Documentation by YARD 0.9.16
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 = "Button";
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 (B)</a> &raquo;
40
-
41
-
42
- <span class="title">Button</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: Button
63
-
64
-
65
-
66
- </h1>
67
- <div class="box_info">
68
-
69
- <dl>
70
- <dt>Inherits:</dt>
71
- <dd>
72
- <span class="inheritName"><span class='object_link'><a href="BinaryReceptor.html" title="BinaryReceptor (class)">BinaryReceptor</a></span></span>
73
-
74
- <ul class="fullTree">
75
- <li>Object</li>
76
-
77
- <li class="next"><span class='object_link'><a href="Receptor.html" title="Receptor (class)">Receptor</a></span></li>
78
-
79
- <li class="next"><span class='object_link'><a href="BinaryReceptor.html" title="BinaryReceptor (class)">BinaryReceptor</a></span></li>
80
-
81
- <li class="next">Button</li>
82
-
83
- </ul>
84
- <a href="#" class="inheritanceTree">show all</a>
85
-
86
- </dd>
87
- </dl>
88
-
89
-
90
-
91
-
92
-
93
-
94
-
95
-
96
-
97
-
98
-
99
- <dl>
100
- <dt>Defined in:</dt>
101
- <dd>lib/button.rb</dd>
102
- </dl>
103
-
104
- </div>
105
-
106
- <h2>Overview</h2><div class="docstring">
107
- <div class="discussion">
108
-
109
- <p>Button - simple push button</p>
110
-
111
-
112
- </div>
113
- </div>
114
- <div class="tags">
115
-
116
-
117
- </div>
118
-
119
-
120
-
121
- <h2>Instance Attribute Summary <small><a href="#" class="summary_toggle">collapse</a></small></h2>
122
- <ul class="summary">
123
-
124
- <li class="public ">
125
- <span class="summary_signature">
126
-
127
- <a href="#measure_pause=-instance_method" title="#measure_pause= (instance method)">#<strong>measure_pause</strong> &#x21d2; Object </a>
128
-
129
-
130
-
131
- </span>
132
-
133
-
134
-
135
-
136
-
137
- <span class="note title writeonly">writeonly</span>
138
-
139
-
140
-
141
-
142
-
143
-
144
-
145
-
146
- <span class="summary_desc"><div class='inline'>
147
- <p>Sets the attribute measure_pause.</p>
148
- </div></span>
149
-
150
- </li>
151
-
152
-
153
- </ul>
154
-
155
-
156
-
157
-
158
-
159
- <h2>
160
- Instance Method Summary
161
- <small><a href="#" class="summary_toggle">collapse</a></small>
162
- </h2>
163
-
164
- <ul class="summary">
165
-
166
- <li class="public ">
167
- <span class="summary_signature">
168
-
169
- <a href="#double_press%3F-instance_method" title="#double_press? (instance method)">#<strong>double_press?</strong>(intervals = @intervals) &#x21d2; Boolean </a>
170
-
171
-
172
-
173
- </span>
174
-
175
-
176
-
177
-
178
-
179
-
180
-
181
-
182
-
183
- <span class="summary_desc"><div class='inline'>
184
- <p>Was the button pressed twice?.</p>
185
- </div></span>
186
-
187
- </li>
188
-
189
-
190
- <li class="public ">
191
- <span class="summary_signature">
192
-
193
- <a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(pin) &#x21d2; Button </a>
194
-
195
-
196
-
197
- </span>
198
-
199
-
200
- <span class="note title constructor">constructor</span>
201
-
202
-
203
-
204
-
205
-
206
-
207
-
208
-
209
- <span class="summary_desc"><div class='inline'>
210
- <p>A new instance of Button.</p>
211
- </div></span>
212
-
213
- </li>
214
-
215
-
216
- <li class="public ">
217
- <span class="summary_signature">
218
-
219
- <a href="#long_press%3F-instance_method" title="#long_press? (instance method)">#<strong>long_press?</strong>(intervals = @intervals) &#x21d2; Boolean </a>
220
-
221
-
222
-
223
- </span>
224
-
225
-
226
-
227
-
228
-
229
-
230
-
231
-
232
-
233
- <span class="summary_desc"><div class='inline'>
234
- <p>Was the button pressed for more than @long_click?.</p>
235
- </div></span>
236
-
237
- </li>
238
-
239
-
240
- <li class="public ">
241
- <span class="summary_signature">
242
-
243
- <a href="#not_pressed%3F-instance_method" title="#not_pressed? (instance method)">#<strong>not_pressed?</strong> &#x21d2; Boolean </a>
244
-
245
-
246
-
247
- </span>
248
-
249
-
250
-
251
-
252
-
253
-
254
-
255
-
256
-
257
- <span class="summary_desc"><div class='inline'>
258
- <p>Is button not pressed?.</p>
259
- </div></span>
260
-
261
- </li>
262
-
263
-
264
- <li class="public ">
265
- <span class="summary_signature">
266
-
267
- <a href="#pressed%3F-instance_method" title="#pressed? (instance method)">#<strong>pressed?</strong> &#x21d2; Boolean </a>
268
-
269
-
270
-
271
- </span>
272
-
273
-
274
-
275
-
276
-
277
-
278
-
279
-
280
-
281
- <span class="summary_desc"><div class='inline'>
282
- <p>Is button pressed?.</p>
283
- </div></span>
284
-
285
- </li>
286
-
287
-
288
- <li class="public ">
289
- <span class="summary_signature">
290
-
291
- <a href="#single_press%3F-instance_method" title="#single_press? (instance method)">#<strong>single_press?</strong>(intervals = @intervals) &#x21d2; Boolean </a>
292
-
293
-
294
-
295
- </span>
296
-
297
-
298
-
299
-
300
-
301
-
302
-
303
-
304
-
305
- <span class="summary_desc"><div class='inline'>
306
- <p>Was the button pressed once?.</p>
307
- </div></span>
308
-
309
- </li>
310
-
311
-
312
- <li class="public ">
313
- <span class="summary_signature">
314
-
315
- <a href="#triple_press%3F-instance_method" title="#triple_press? (instance method)">#<strong>triple_press?</strong>(intervals = @intervals) &#x21d2; Boolean </a>
316
-
317
-
318
-
319
- </span>
320
-
321
-
322
-
323
-
324
-
325
-
326
-
327
-
328
-
329
- <span class="summary_desc"><div class='inline'>
330
- <p>Was the button pressed 3 times?.</p>
331
- </div></span>
332
-
333
- </li>
334
-
335
-
336
- <li class="public ">
337
- <span class="summary_signature">
338
-
339
- <a href="#wait_for_press-instance_method" title="#wait_for_press (instance method)">#<strong>wait_for_press</strong> &#x21d2; Object </a>
340
-
341
-
342
-
343
- </span>
344
-
345
-
346
-
347
-
348
-
349
-
350
-
351
-
352
-
353
- <span class="summary_desc"><div class='inline'>
354
- <p>Wait for the 1st pressing of button.</p>
355
- </div></span>
356
-
357
- </li>
358
-
359
-
360
- <li class="public ">
361
- <span class="summary_signature">
362
-
363
- <a href="#wait_for_presses-instance_method" title="#wait_for_presses (instance method)">#<strong>wait_for_presses</strong>(attempts = 2) &#x21d2; Object </a>
364
-
365
-
366
-
367
- </span>
368
-
369
-
370
-
371
-
372
-
373
-
374
-
375
-
376
-
377
- <span class="summary_desc"><div class='inline'>
378
- <p>Wait for several sequential presses.</p>
379
- </div></span>
380
-
381
- </li>
382
-
383
-
384
- </ul>
385
-
386
-
387
-
388
-
389
-
390
-
391
-
392
-
393
-
394
-
395
-
396
- <h3 class="inherited">Methods inherited from <span class='object_link'><a href="BinaryReceptor.html" title="BinaryReceptor (class)">BinaryReceptor</a></span></h3>
397
- <p class="inherited"><span class='object_link'><a href="BinaryReceptor.html#high%3F-instance_method" title="BinaryReceptor#high? (method)">#high?</a></span>, <span class='object_link'><a href="BinaryReceptor.html#low%3F-instance_method" title="BinaryReceptor#low? (method)">#low?</a></span></p>
398
-
399
-
400
-
401
-
402
-
403
-
404
-
405
-
406
-
407
- <h3 class="inherited">Methods inherited from <span class='object_link'><a href="Receptor.html" title="Receptor (class)">Receptor</a></span></h3>
408
- <p class="inherited"><span class='object_link'><a href="Receptor.html#model_name-instance_method" title="Receptor#model_name (method)">#model_name</a></span>, <span class='object_link'><a href="Receptor.html#name-instance_method" title="Receptor#name (method)">#name</a></span></p>
409
- <div id="constructor_details" class="method_details_list">
410
- <h2>Constructor Details</h2>
411
-
412
- <div class="method_details first">
413
- <h3 class="signature first" id="initialize-instance_method">
414
-
415
- #<strong>initialize</strong>(pin) &#x21d2; <tt><span class='object_link'><a href="" title="Button (class)">Button</a></span></tt>
416
-
417
-
418
-
419
-
420
-
421
- </h3><div class="docstring">
422
- <div class="discussion">
423
-
424
- <p>Returns a new instance of Button</p>
425
-
426
-
427
- </div>
428
- </div>
429
- <div class="tags">
430
-
431
-
432
- </div><table class="source_code">
433
- <tr>
434
- <td>
435
- <pre class="lines">
436
-
437
-
438
- 7
439
- 8
440
- 9
441
- 10
442
- 11
443
- 12
444
- 13
445
- 14</pre>
446
- </td>
447
- <td>
448
- <pre class="code"><span class="info file"># File 'lib/button.rb', line 7</span>
449
-
450
- <span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_pin'>pin</span><span class='rparen'>)</span>
451
- <span class='id identifier rubyid_receptor_name'>receptor_name</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>BUTTON</span><span class='tstring_end'>&#39;</span></span>
452
- <span class='kw'>super</span><span class='lparen'>(</span><span class='id identifier rubyid_pin'>pin</span><span class='rparen'>)</span>
453
- <span class='ivar'>@measure_pause</span> <span class='op'>=</span> <span class='float'>0.01</span>
454
- <span class='ivar'>@long_click</span> <span class='op'>=</span> <span class='float'>1.0</span>
455
- <span class='ivar'>@short_interval</span> <span class='op'>=</span> <span class='float'>0.2</span>
456
- <span class='ivar'>@intervals</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
457
- <span class='kw'>end</span></pre>
458
- </td>
459
- </tr>
460
- </table>
461
- </div>
462
-
463
- </div>
464
-
465
- <div id="instance_attr_details" class="attr_details">
466
- <h2>Instance Attribute Details</h2>
467
-
468
-
469
- <span id=""></span>
470
- <div class="method_details first">
471
- <h3 class="signature first" id="measure_pause=-instance_method">
472
-
473
- #<strong>measure_pause=</strong>(value) &#x21d2; <tt>Object</tt> <span class="extras">(writeonly)</span>
474
-
475
-
476
-
477
-
478
-
479
- </h3><div class="docstring">
480
- <div class="discussion">
481
-
482
- <p>Sets the attribute measure_pause</p>
483
-
484
-
485
- </div>
486
- </div>
487
- <div class="tags">
488
- <p class="tag_title">Parameters:</p>
489
- <ul class="param">
490
-
491
- <li>
492
-
493
- <span class='name'>value</span>
494
-
495
-
496
- <span class='type'></span>
497
-
498
-
499
-
500
- &mdash;
501
- <div class='inline'>
502
- <p>the value to set the attribute measure_pause to.</p>
503
- </div>
504
-
505
- </li>
506
-
507
- </ul>
508
-
509
-
510
- </div><table class="source_code">
511
- <tr>
512
- <td>
513
- <pre class="lines">
514
-
515
-
516
- 5
517
- 6
518
- 7</pre>
519
- </td>
520
- <td>
521
- <pre class="code"><span class="info file"># File 'lib/button.rb', line 5</span>
522
-
523
- <span class='kw'>def</span> <span class='id identifier rubyid_measure_pause='>measure_pause=</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
524
- <span class='ivar'>@measure_pause</span> <span class='op'>=</span> <span class='id identifier rubyid_value'>value</span>
525
- <span class='kw'>end</span></pre>
526
- </td>
527
- </tr>
528
- </table>
529
- </div>
530
-
531
- </div>
532
-
533
-
534
- <div id="instance_method_details" class="method_details_list">
535
- <h2>Instance Method Details</h2>
536
-
537
-
538
- <div class="method_details first">
539
- <h3 class="signature first" id="double_press?-instance_method">
540
-
541
- #<strong>double_press?</strong>(intervals = @intervals) &#x21d2; <tt>Boolean</tt>
542
-
543
-
544
-
545
-
546
-
547
- </h3><div class="docstring">
548
- <div class="discussion">
549
-
550
- <p>Was the button pressed twice?</p>
551
-
552
-
553
- </div>
554
- </div>
555
- <div class="tags">
556
-
557
- <p class="tag_title">Returns:</p>
558
- <ul class="return">
559
-
560
- <li>
561
-
562
-
563
- <span class='type'>(<tt>Boolean</tt>)</span>
564
-
565
-
566
-
567
- </li>
568
-
569
- </ul>
570
-
571
- </div><table class="source_code">
572
- <tr>
573
- <td>
574
- <pre class="lines">
575
-
576
-
577
- 57
578
- 58
579
- 59</pre>
580
- </td>
581
- <td>
582
- <pre class="code"><span class="info file"># File 'lib/button.rb', line 57</span>
583
-
584
- <span class='kw'>def</span> <span class='id identifier rubyid_double_press?'>double_press?</span><span class='lparen'>(</span><span class='id identifier rubyid_intervals'>intervals</span><span class='op'>=</span><span class='ivar'>@intervals</span><span class='rparen'>)</span>
585
- <span class='id identifier rubyid_intervals'>intervals</span><span class='period'>.</span><span class='id identifier rubyid_size'>size</span> <span class='op'>==</span> <span class='int'>2</span> <span class='op'>&amp;&amp;</span> <span class='id identifier rubyid_intervals'>intervals</span><span class='lbracket'>[</span><span class='int'>1</span><span class='rbracket'>]</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span> <span class='op'>&lt;=</span> <span class='ivar'>@short_interval</span>
586
- <span class='kw'>end</span></pre>
587
- </td>
588
- </tr>
589
- </table>
590
- </div>
591
-
592
- <div class="method_details ">
593
- <h3 class="signature " id="long_press?-instance_method">
594
-
595
- #<strong>long_press?</strong>(intervals = @intervals) &#x21d2; <tt>Boolean</tt>
596
-
597
-
598
-
599
-
600
-
601
- </h3><div class="docstring">
602
- <div class="discussion">
603
-
604
- <p>Was the button pressed for more than @long_click?</p>
605
-
606
-
607
- </div>
608
- </div>
609
- <div class="tags">
610
-
611
- <p class="tag_title">Returns:</p>
612
- <ul class="return">
613
-
614
- <li>
615
-
616
-
617
- <span class='type'>(<tt>Boolean</tt>)</span>
618
-
619
-
620
-
621
- </li>
622
-
623
- </ul>
624
-
625
- </div><table class="source_code">
626
- <tr>
627
- <td>
628
- <pre class="lines">
629
-
630
-
631
- 67
632
- 68
633
- 69</pre>
634
- </td>
635
- <td>
636
- <pre class="code"><span class="info file"># File 'lib/button.rb', line 67</span>
637
-
638
- <span class='kw'>def</span> <span class='id identifier rubyid_long_press?'>long_press?</span><span class='lparen'>(</span><span class='id identifier rubyid_intervals'>intervals</span><span class='op'>=</span><span class='ivar'>@intervals</span><span class='rparen'>)</span>
639
- <span class='id identifier rubyid_intervals'>intervals</span><span class='period'>.</span><span class='id identifier rubyid_size'>size</span> <span class='op'>==</span> <span class='int'>1</span> <span class='op'>&amp;&amp;</span> <span class='id identifier rubyid_intervals'>intervals</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span><span class='lbracket'>[</span><span class='int'>1</span><span class='rbracket'>]</span> <span class='op'>&gt;=</span> <span class='ivar'>@long_click</span>
640
- <span class='kw'>end</span></pre>
641
- </td>
642
- </tr>
643
- </table>
644
- </div>
645
-
646
- <div class="method_details ">
647
- <h3 class="signature " id="not_pressed?-instance_method">
648
-
649
- #<strong>not_pressed?</strong> &#x21d2; <tt>Boolean</tt>
650
-
651
-
652
-
653
-
654
-
655
- </h3><div class="docstring">
656
- <div class="discussion">
657
-
658
- <p>Is button not pressed?</p>
659
-
660
-
661
- </div>
662
- </div>
663
- <div class="tags">
664
-
665
- <p class="tag_title">Returns:</p>
666
- <ul class="return">
667
-
668
- <li>
669
-
670
-
671
- <span class='type'>(<tt>Boolean</tt>)</span>
672
-
673
-
674
-
675
- </li>
676
-
677
- </ul>
678
-
679
- </div><table class="source_code">
680
- <tr>
681
- <td>
682
- <pre class="lines">
683
-
684
-
685
- 22
686
- 23
687
- 24</pre>
688
- </td>
689
- <td>
690
- <pre class="code"><span class="info file"># File 'lib/button.rb', line 22</span>
691
-
692
- <span class='kw'>def</span> <span class='id identifier rubyid_not_pressed?'>not_pressed?</span>
693
- <span class='id identifier rubyid_high?'>high?</span>
694
- <span class='kw'>end</span></pre>
695
- </td>
696
- </tr>
697
- </table>
698
- </div>
699
-
700
- <div class="method_details ">
701
- <h3 class="signature " id="pressed?-instance_method">
702
-
703
- #<strong>pressed?</strong> &#x21d2; <tt>Boolean</tt>
704
-
705
-
706
-
707
-
708
-
709
- </h3><div class="docstring">
710
- <div class="discussion">
711
-
712
- <p>Is button pressed?</p>
713
-
714
-
715
- </div>
716
- </div>
717
- <div class="tags">
718
-
719
- <p class="tag_title">Returns:</p>
720
- <ul class="return">
721
-
722
- <li>
723
-
724
-
725
- <span class='type'>(<tt>Boolean</tt>)</span>
726
-
727
-
728
-
729
- </li>
730
-
731
- </ul>
732
-
733
- </div><table class="source_code">
734
- <tr>
735
- <td>
736
- <pre class="lines">
737
-
738
-
739
- 17
740
- 18
741
- 19</pre>
742
- </td>
743
- <td>
744
- <pre class="code"><span class="info file"># File 'lib/button.rb', line 17</span>
745
-
746
- <span class='kw'>def</span> <span class='id identifier rubyid_pressed?'>pressed?</span>
747
- <span class='id identifier rubyid_low?'>low?</span>
748
- <span class='kw'>end</span></pre>
749
- </td>
750
- </tr>
751
- </table>
752
- </div>
753
-
754
- <div class="method_details ">
755
- <h3 class="signature " id="single_press?-instance_method">
756
-
757
- #<strong>single_press?</strong>(intervals = @intervals) &#x21d2; <tt>Boolean</tt>
758
-
759
-
760
-
761
-
762
-
763
- </h3><div class="docstring">
764
- <div class="discussion">
765
-
766
- <p>Was the button pressed once?</p>
767
-
768
-
769
- </div>
770
- </div>
771
- <div class="tags">
772
-
773
- <p class="tag_title">Returns:</p>
774
- <ul class="return">
775
-
776
- <li>
777
-
778
-
779
- <span class='type'>(<tt>Boolean</tt>)</span>
780
-
781
-
782
-
783
- </li>
784
-
785
- </ul>
786
-
787
- </div><table class="source_code">
788
- <tr>
789
- <td>
790
- <pre class="lines">
791
-
792
-
793
- 52
794
- 53
795
- 54</pre>
796
- </td>
797
- <td>
798
- <pre class="code"><span class="info file"># File 'lib/button.rb', line 52</span>
799
-
800
- <span class='kw'>def</span> <span class='id identifier rubyid_single_press?'>single_press?</span><span class='lparen'>(</span><span class='id identifier rubyid_intervals'>intervals</span><span class='op'>=</span><span class='ivar'>@intervals</span><span class='rparen'>)</span>
801
- <span class='id identifier rubyid_intervals'>intervals</span><span class='period'>.</span><span class='id identifier rubyid_size'>size</span> <span class='op'>==</span> <span class='int'>1</span>
802
- <span class='kw'>end</span></pre>
803
- </td>
804
- </tr>
805
- </table>
806
- </div>
807
-
808
- <div class="method_details ">
809
- <h3 class="signature " id="triple_press?-instance_method">
810
-
811
- #<strong>triple_press?</strong>(intervals = @intervals) &#x21d2; <tt>Boolean</tt>
812
-
813
-
814
-
815
-
816
-
817
- </h3><div class="docstring">
818
- <div class="discussion">
819
-
820
- <p>Was the button pressed 3 times?</p>
821
-
822
-
823
- </div>
824
- </div>
825
- <div class="tags">
826
-
827
- <p class="tag_title">Returns:</p>
828
- <ul class="return">
829
-
830
- <li>
831
-
832
-
833
- <span class='type'>(<tt>Boolean</tt>)</span>
834
-
835
-
836
-
837
- </li>
838
-
839
- </ul>
840
-
841
- </div><table class="source_code">
842
- <tr>
843
- <td>
844
- <pre class="lines">
845
-
846
-
847
- 62
848
- 63
849
- 64</pre>
850
- </td>
851
- <td>
852
- <pre class="code"><span class="info file"># File 'lib/button.rb', line 62</span>
853
-
854
- <span class='kw'>def</span> <span class='id identifier rubyid_triple_press?'>triple_press?</span><span class='lparen'>(</span><span class='id identifier rubyid_intervals'>intervals</span><span class='op'>=</span><span class='ivar'>@intervals</span><span class='rparen'>)</span>
855
- <span class='id identifier rubyid_intervals'>intervals</span><span class='period'>.</span><span class='id identifier rubyid_size'>size</span> <span class='op'>==</span> <span class='int'>3</span>
856
- <span class='kw'>end</span></pre>
857
- </td>
858
- </tr>
859
- </table>
860
- </div>
861
-
862
- <div class="method_details ">
863
- <h3 class="signature " id="wait_for_press-instance_method">
864
-
865
- #<strong>wait_for_press</strong> &#x21d2; <tt>Object</tt>
866
-
867
-
868
-
869
-
870
-
871
- </h3><div class="docstring">
872
- <div class="discussion">
873
-
874
- <p>Wait for the 1st pressing of button</p>
875
-
876
-
877
- </div>
878
- </div>
879
- <div class="tags">
880
-
881
-
882
- </div><table class="source_code">
883
- <tr>
884
- <td>
885
- <pre class="lines">
886
-
887
-
888
- 27
889
- 28
890
- 29</pre>
891
- </td>
892
- <td>
893
- <pre class="code"><span class="info file"># File 'lib/button.rb', line 27</span>
894
-
895
- <span class='kw'>def</span> <span class='id identifier rubyid_wait_for_press'>wait_for_press</span>
896
- <span class='id identifier rubyid_wait_for_presses'>wait_for_presses</span><span class='lparen'>(</span><span class='int'>1</span><span class='rparen'>)</span>
897
- <span class='kw'>end</span></pre>
898
- </td>
899
- </tr>
900
- </table>
901
- </div>
902
-
903
- <div class="method_details ">
904
- <h3 class="signature " id="wait_for_presses-instance_method">
905
-
906
- #<strong>wait_for_presses</strong>(attempts = 2) &#x21d2; <tt>Object</tt>
907
-
908
-
909
-
910
-
911
-
912
- </h3><div class="docstring">
913
- <div class="discussion">
914
-
915
- <p>Wait for several sequential presses</p>
916
-
917
-
918
- </div>
919
- </div>
920
- <div class="tags">
921
-
922
-
923
- </div><table class="source_code">
924
- <tr>
925
- <td>
926
- <pre class="lines">
927
-
928
-
929
- 32
930
- 33
931
- 34
932
- 35
933
- 36
934
- 37
935
- 38
936
- 39
937
- 40
938
- 41
939
- 42
940
- 43
941
- 44
942
- 45
943
- 46
944
- 47
945
- 48
946
- 49</pre>
947
- </td>
948
- <td>
949
- <pre class="code"><span class="info file"># File 'lib/button.rb', line 32</span>
950
-
951
- <span class='kw'>def</span> <span class='id identifier rubyid_wait_for_presses'>wait_for_presses</span><span class='lparen'>(</span><span class='id identifier rubyid_attempts'>attempts</span><span class='op'>=</span><span class='int'>2</span><span class='rparen'>)</span>
952
- <span class='ivar'>@intervals</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
953
- <span class='id identifier rubyid_attempts'>attempts</span><span class='period'>.</span><span class='id identifier rubyid_times'>times</span> <span class='kw'>do</span>
954
- <span class='id identifier rubyid_interval'>interval</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
955
- <span class='id identifier rubyid_timer'>timer</span> <span class='op'>=</span> <span class='const'>Time</span><span class='period'>.</span><span class='id identifier rubyid_now'>now</span>
956
- <span class='kw'>while</span> <span class='id identifier rubyid_not_pressed?'>not_pressed?</span> <span class='kw'>do</span>
957
- <span class='id identifier rubyid_sleep'>sleep</span> <span class='ivar'>@measure_pause</span>
958
- <span class='kw'>end</span>
959
- <span class='id identifier rubyid_interval'>interval</span> <span class='op'>&lt;&lt;</span> <span class='const'>Time</span><span class='period'>.</span><span class='id identifier rubyid_now'>now</span><span class='op'>-</span><span class='id identifier rubyid_timer'>timer</span>
960
- <span class='id identifier rubyid_timer'>timer</span> <span class='op'>=</span> <span class='const'>Time</span><span class='period'>.</span><span class='id identifier rubyid_now'>now</span>
961
- <span class='kw'>while</span> <span class='id identifier rubyid_pressed?'>pressed?</span> <span class='kw'>do</span>
962
- <span class='id identifier rubyid_sleep'>sleep</span> <span class='ivar'>@measure_pause</span>
963
- <span class='kw'>end</span>
964
- <span class='id identifier rubyid_interval'>interval</span> <span class='op'>&lt;&lt;</span> <span class='const'>Time</span><span class='period'>.</span><span class='id identifier rubyid_now'>now</span><span class='op'>-</span><span class='id identifier rubyid_timer'>timer</span>
965
- <span class='ivar'>@intervals</span> <span class='op'>&lt;&lt;</span> <span class='id identifier rubyid_interval'>interval</span>
966
- <span class='kw'>end</span>
967
- <span class='ivar'>@intervals</span>
968
- <span class='kw'>end</span></pre>
969
- </td>
970
- </tr>
971
- </table>
972
- </div>
973
-
974
- </div>
975
-
976
- </div>
977
-
978
- <div id="footer">
979
- Generated on Tue Dec 18 16:03:42 2018 by
980
- <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
981
- 0.9.16 (ruby-2.3.3).
982
- </div>
983
-
984
- </div>
985
- </body>
986
- </html>