dxopal 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +5 -0
- data/.ignore +5 -0
- data/.nojekyll +4 -0
- data/CHANGELOG.md +90 -0
- data/DEVELOPMENT.md +57 -0
- data/Gemfile +2 -0
- data/Gemfile.lock +39 -0
- data/README.md +22 -0
- data/Rakefile +66 -0
- data/TODO.md +278 -0
- data/build/dxopal.js +46590 -0
- data/build/dxopal.min.js +1 -0
- data/config.ru +39 -0
- data/doc/api/DXOpal.html +129 -0
- data/doc/api/DXOpal/Font.html +485 -0
- data/doc/api/DXOpal/Image.html +2533 -0
- data/doc/api/DXOpal/Input.html +1086 -0
- data/doc/api/DXOpal/Input/MouseCodes.html +146 -0
- data/doc/api/DXOpal/RemoteResource.html +641 -0
- data/doc/api/DXOpal/Sound.html +568 -0
- data/doc/api/DXOpal/SoundEffect.html +444 -0
- data/doc/api/DXOpal/SoundEffect/WaveTypes.html +130 -0
- data/doc/api/DXOpal/Sprite.html +1419 -0
- data/doc/api/DXOpal/Window.html +1915 -0
- data/doc/api/_index.html +228 -0
- data/doc/api/class_list.html +51 -0
- data/doc/api/css/common.css +1 -0
- data/doc/api/css/full_list.css +58 -0
- data/doc/api/css/style.css +492 -0
- data/doc/api/file.CHANGELOG.html +162 -0
- data/doc/api/file.README.html +124 -0
- data/doc/api/file_list.html +61 -0
- data/doc/api/frames.html +17 -0
- data/doc/api/index.html +124 -0
- data/doc/api/js/app.js +248 -0
- data/doc/api/js/full_list.js +216 -0
- data/doc/api/js/jquery.js +4 -0
- data/doc/api/method_list.html +939 -0
- data/doc/api/top-level-namespace.html +110 -0
- data/doc/en/index.html +93 -0
- data/doc/ja/index.html +92 -0
- data/dxopal.gemspec +29 -0
- data/exe/dxopal +44 -0
- data/index.html +56 -0
- data/opal/dxopal.rb +54 -0
- data/opal/dxopal/constants/colors.rb +16 -0
- data/opal/dxopal/font.rb +20 -0
- data/opal/dxopal/image.rb +301 -0
- data/opal/dxopal/input.rb +170 -0
- data/opal/dxopal/input/key_codes.rb +168 -0
- data/opal/dxopal/remote_resource.rb +65 -0
- data/opal/dxopal/sound.rb +53 -0
- data/opal/dxopal/sound_effect.rb +84 -0
- data/opal/dxopal/sprite.rb +94 -0
- data/opal/dxopal/sprite/collision_area.rb +288 -0
- data/opal/dxopal/sprite/collision_check.rb +106 -0
- data/opal/dxopal/sprite/collision_checker.rb +169 -0
- data/opal/dxopal/sprite/physics.rb +82 -0
- data/opal/dxopal/version.rb +3 -0
- data/opal/dxopal/window.rb +173 -0
- data/template/index.html +13 -0
- data/template/main.rb +9 -0
- metadata +191 -0
@@ -0,0 +1,146 @@
|
|
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: DXOpal::Input::MouseCodes
|
8
|
+
|
9
|
+
— Documentation by YARD 0.9.9
|
10
|
+
|
11
|
+
</title>
|
12
|
+
|
13
|
+
<link rel="stylesheet" href="../../css/style.css" type="text/css" charset="utf-8" />
|
14
|
+
|
15
|
+
<link rel="stylesheet" href="../../css/common.css" type="text/css" charset="utf-8" />
|
16
|
+
|
17
|
+
<script type="text/javascript" charset="utf-8">
|
18
|
+
pathId = "DXOpal::Input::MouseCodes";
|
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="../../DXOpal.html" title="DXOpal (module)">DXOpal</a></span></span> » <span class='title'><span class='object_link'><a href="../Input.html" title="DXOpal::Input (module)">Input</a></span></span>
|
41
|
+
»
|
42
|
+
<span class="title">MouseCodes</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: DXOpal::Input::MouseCodes
|
63
|
+
|
64
|
+
|
65
|
+
|
66
|
+
</h1>
|
67
|
+
<div class="box_info">
|
68
|
+
|
69
|
+
|
70
|
+
|
71
|
+
|
72
|
+
|
73
|
+
|
74
|
+
|
75
|
+
|
76
|
+
|
77
|
+
|
78
|
+
|
79
|
+
<dl>
|
80
|
+
<dt>Defined in:</dt>
|
81
|
+
<dd>opal/dxopal/input.rb</dd>
|
82
|
+
</dl>
|
83
|
+
|
84
|
+
</div>
|
85
|
+
|
86
|
+
|
87
|
+
<h2>Constant Summary</h2>
|
88
|
+
<dl class="constants">
|
89
|
+
|
90
|
+
<dt id="M_LBUTTON-constant" class="">M_LBUTTON =
|
91
|
+
|
92
|
+
</dt>
|
93
|
+
<dd><pre class="code"><span class='int'>1</span></pre></dd>
|
94
|
+
|
95
|
+
<dt id="M_RBUTTON-constant" class="">M_RBUTTON =
|
96
|
+
|
97
|
+
</dt>
|
98
|
+
<dd><pre class="code"><span class='int'>2</span></pre></dd>
|
99
|
+
|
100
|
+
<dt id="M_MBUTTON-constant" class="">M_MBUTTON =
|
101
|
+
|
102
|
+
</dt>
|
103
|
+
<dd><pre class="code"><span class='int'>4</span></pre></dd>
|
104
|
+
|
105
|
+
<dt id="M_4TH_BUTTON-constant" class="">M_4TH_BUTTON =
|
106
|
+
<div class="docstring">
|
107
|
+
<div class="discussion">
|
108
|
+
|
109
|
+
<p>DXOpal extention</p>
|
110
|
+
|
111
|
+
|
112
|
+
</div>
|
113
|
+
</div>
|
114
|
+
<div class="tags">
|
115
|
+
|
116
|
+
|
117
|
+
</div>
|
118
|
+
</dt>
|
119
|
+
<dd><pre class="code"><span class='int'>8</span></pre></dd>
|
120
|
+
|
121
|
+
<dt id="M_5TH_BUTTON-constant" class="">M_5TH_BUTTON =
|
122
|
+
|
123
|
+
</dt>
|
124
|
+
<dd><pre class="code"><span class='int'>16</span></pre></dd>
|
125
|
+
|
126
|
+
</dl>
|
127
|
+
|
128
|
+
|
129
|
+
|
130
|
+
|
131
|
+
|
132
|
+
|
133
|
+
|
134
|
+
|
135
|
+
|
136
|
+
</div>
|
137
|
+
|
138
|
+
<div id="footer">
|
139
|
+
Generated on Tue Oct 17 13:56:27 2017 by
|
140
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
141
|
+
0.9.9 (ruby-2.4.2).
|
142
|
+
</div>
|
143
|
+
|
144
|
+
</div>
|
145
|
+
</body>
|
146
|
+
</html>
|
@@ -0,0 +1,641 @@
|
|
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: DXOpal::RemoteResource
|
8
|
+
|
9
|
+
— Documentation by YARD 0.9.9
|
10
|
+
|
11
|
+
</title>
|
12
|
+
|
13
|
+
<link rel="stylesheet" href="../css/style.css" type="text/css" charset="utf-8" />
|
14
|
+
|
15
|
+
<link rel="stylesheet" href="../css/common.css" type="text/css" charset="utf-8" />
|
16
|
+
|
17
|
+
<script type="text/javascript" charset="utf-8">
|
18
|
+
pathId = "DXOpal::RemoteResource";
|
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 (R)</a> »
|
40
|
+
<span class='title'><span class='object_link'><a href="../DXOpal.html" title="DXOpal (module)">DXOpal</a></span></span>
|
41
|
+
»
|
42
|
+
<span class="title">RemoteResource</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: DXOpal::RemoteResource
|
63
|
+
|
64
|
+
|
65
|
+
|
66
|
+
</h1>
|
67
|
+
<div class="box_info">
|
68
|
+
|
69
|
+
<dl>
|
70
|
+
<dt>Inherits:</dt>
|
71
|
+
<dd>
|
72
|
+
<span class="inheritName">Object</span>
|
73
|
+
|
74
|
+
<ul class="fullTree">
|
75
|
+
<li>Object</li>
|
76
|
+
|
77
|
+
<li class="next">DXOpal::RemoteResource</li>
|
78
|
+
|
79
|
+
</ul>
|
80
|
+
<a href="#" class="inheritanceTree">show all</a>
|
81
|
+
|
82
|
+
</dd>
|
83
|
+
</dl>
|
84
|
+
|
85
|
+
|
86
|
+
|
87
|
+
|
88
|
+
|
89
|
+
|
90
|
+
|
91
|
+
|
92
|
+
|
93
|
+
|
94
|
+
|
95
|
+
<dl>
|
96
|
+
<dt>Defined in:</dt>
|
97
|
+
<dd>opal/dxopal/remote_resource.rb</dd>
|
98
|
+
</dl>
|
99
|
+
|
100
|
+
</div>
|
101
|
+
|
102
|
+
<h2>Overview</h2><div class="docstring">
|
103
|
+
<div class="discussion">
|
104
|
+
|
105
|
+
<p>A base class for resources acquired through JS Promises. Provides
|
106
|
+
`<klass>.register` and `<<a href="name">klass></a>`. A subclass
|
107
|
+
must impelment `<klass>._load`.</p>
|
108
|
+
|
109
|
+
|
110
|
+
</div>
|
111
|
+
</div>
|
112
|
+
<div class="tags">
|
113
|
+
|
114
|
+
|
115
|
+
</div><div id="subclasses">
|
116
|
+
<h2>Direct Known Subclasses</h2>
|
117
|
+
<p class="children"><span class='object_link'><a href="Image.html" title="DXOpal::Image (class)">Image</a></span>, <span class='object_link'><a href="Sound.html" title="DXOpal::Sound (class)">Sound</a></span></p>
|
118
|
+
</div>
|
119
|
+
|
120
|
+
<h2>Constant Summary</h2>
|
121
|
+
<dl class="constants">
|
122
|
+
|
123
|
+
<dt id="resources-classvariable" class="">@@resources =
|
124
|
+
<div class="docstring">
|
125
|
+
<div class="discussion">
|
126
|
+
|
127
|
+
<p>List of registered resources (Contains path_or_url)</p>
|
128
|
+
|
129
|
+
|
130
|
+
</div>
|
131
|
+
</div>
|
132
|
+
<div class="tags">
|
133
|
+
|
134
|
+
|
135
|
+
</div>
|
136
|
+
</dt>
|
137
|
+
<dd><pre class="code"><span class='const'>Hash</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_h'>h</span><span class='comma'>,</span><span class='id identifier rubyid_k'>k</span><span class='op'>|</span> <span class='id identifier rubyid_h'>h</span><span class='lbracket'>[</span><span class='id identifier rubyid_k'>k</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rbrace'>}</span></pre></dd>
|
138
|
+
|
139
|
+
<dt id="promises-classvariable" class="">@@promises =
|
140
|
+
<div class="docstring">
|
141
|
+
<div class="discussion">
|
142
|
+
|
143
|
+
<p>Contains promises</p>
|
144
|
+
|
145
|
+
|
146
|
+
</div>
|
147
|
+
</div>
|
148
|
+
<div class="tags">
|
149
|
+
|
150
|
+
|
151
|
+
</div>
|
152
|
+
</dt>
|
153
|
+
<dd><pre class="code"><span class='const'>Hash</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_h'>h</span><span class='comma'>,</span><span class='id identifier rubyid_k'>k</span><span class='op'>|</span> <span class='id identifier rubyid_h'>h</span><span class='lbracket'>[</span><span class='id identifier rubyid_k'>k</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rbrace'>}</span></pre></dd>
|
154
|
+
|
155
|
+
<dt id="instances-classvariable" class="">@@instances =
|
156
|
+
<div class="docstring">
|
157
|
+
<div class="discussion">
|
158
|
+
|
159
|
+
<p>Contains instances of Image, Sound</p>
|
160
|
+
|
161
|
+
|
162
|
+
</div>
|
163
|
+
</div>
|
164
|
+
<div class="tags">
|
165
|
+
|
166
|
+
|
167
|
+
</div>
|
168
|
+
</dt>
|
169
|
+
<dd><pre class="code"><span class='const'>Hash</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_h'>h</span><span class='comma'>,</span><span class='id identifier rubyid_k'>k</span><span class='op'>|</span> <span class='id identifier rubyid_h'>h</span><span class='lbracket'>[</span><span class='id identifier rubyid_k'>k</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rbrace'>}</span></pre></dd>
|
170
|
+
|
171
|
+
<dt id="klasses-classvariable" class="">@@klasses =
|
172
|
+
<div class="docstring">
|
173
|
+
<div class="discussion">
|
174
|
+
|
175
|
+
<p>Subclasses of RemoteResource</p>
|
176
|
+
|
177
|
+
|
178
|
+
</div>
|
179
|
+
</div>
|
180
|
+
<div class="tags">
|
181
|
+
|
182
|
+
|
183
|
+
</div>
|
184
|
+
</dt>
|
185
|
+
<dd><pre class="code"><span class='lbrace'>{</span><span class='rbrace'>}</span></pre></dd>
|
186
|
+
|
187
|
+
</dl>
|
188
|
+
|
189
|
+
|
190
|
+
|
191
|
+
|
192
|
+
|
193
|
+
|
194
|
+
|
195
|
+
|
196
|
+
<h2>
|
197
|
+
Class Method Summary
|
198
|
+
<small><a href="#" class="summary_toggle">collapse</a></small>
|
199
|
+
</h2>
|
200
|
+
|
201
|
+
<ul class="summary">
|
202
|
+
|
203
|
+
<li class="public ">
|
204
|
+
<span class="summary_signature">
|
205
|
+
|
206
|
+
<a href="#[]-class_method" title="[] (class method)">.<strong>[]</strong>(name) ⇒ Object </a>
|
207
|
+
|
208
|
+
|
209
|
+
|
210
|
+
</span>
|
211
|
+
|
212
|
+
|
213
|
+
|
214
|
+
|
215
|
+
|
216
|
+
|
217
|
+
|
218
|
+
|
219
|
+
|
220
|
+
<span class="summary_desc"><div class='inline'>
|
221
|
+
<p>Return instance of loaded resource (call on subclasses).</p>
|
222
|
+
</div></span>
|
223
|
+
|
224
|
+
</li>
|
225
|
+
|
226
|
+
|
227
|
+
<li class="public ">
|
228
|
+
<span class="summary_signature">
|
229
|
+
|
230
|
+
<a href="#_klass_name-class_method" title="_klass_name (class method)">.<strong>_klass_name</strong> ⇒ Object </a>
|
231
|
+
|
232
|
+
|
233
|
+
|
234
|
+
</span>
|
235
|
+
|
236
|
+
|
237
|
+
|
238
|
+
|
239
|
+
|
240
|
+
|
241
|
+
|
242
|
+
|
243
|
+
|
244
|
+
<span class="summary_desc"><div class='inline'>
|
245
|
+
<p>Return a string like “Image” or “Sound”.</p>
|
246
|
+
</div></span>
|
247
|
+
|
248
|
+
</li>
|
249
|
+
|
250
|
+
|
251
|
+
<li class="public ">
|
252
|
+
<span class="summary_signature">
|
253
|
+
|
254
|
+
<a href="#_load-class_method" title="_load (class method)">.<strong>_load</strong>(*args) ⇒ Object </a>
|
255
|
+
|
256
|
+
|
257
|
+
|
258
|
+
</span>
|
259
|
+
|
260
|
+
|
261
|
+
|
262
|
+
|
263
|
+
|
264
|
+
|
265
|
+
|
266
|
+
|
267
|
+
|
268
|
+
<span class="summary_desc"><div class='inline'>
|
269
|
+
<p>Load actual content (defined on subclasses) Return `[instance, promise]`.</p>
|
270
|
+
</div></span>
|
271
|
+
|
272
|
+
</li>
|
273
|
+
|
274
|
+
|
275
|
+
<li class="public ">
|
276
|
+
<span class="summary_signature">
|
277
|
+
|
278
|
+
<a href="#_load_resources-class_method" title="_load_resources (class method)">.<strong>_load_resources</strong>(&block) ⇒ Object </a>
|
279
|
+
|
280
|
+
|
281
|
+
|
282
|
+
</span>
|
283
|
+
|
284
|
+
|
285
|
+
|
286
|
+
|
287
|
+
|
288
|
+
|
289
|
+
|
290
|
+
|
291
|
+
|
292
|
+
<span class="summary_desc"><div class='inline'>
|
293
|
+
<p>Called from Window.load_resources.</p>
|
294
|
+
</div></span>
|
295
|
+
|
296
|
+
</li>
|
297
|
+
|
298
|
+
|
299
|
+
<li class="public ">
|
300
|
+
<span class="summary_signature">
|
301
|
+
|
302
|
+
<a href="#add_class-class_method" title="add_class (class method)">.<strong>add_class</strong>(subklass) ⇒ Object </a>
|
303
|
+
|
304
|
+
|
305
|
+
|
306
|
+
</span>
|
307
|
+
|
308
|
+
|
309
|
+
|
310
|
+
|
311
|
+
|
312
|
+
|
313
|
+
|
314
|
+
|
315
|
+
|
316
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
317
|
+
|
318
|
+
</li>
|
319
|
+
|
320
|
+
|
321
|
+
<li class="public ">
|
322
|
+
<span class="summary_signature">
|
323
|
+
|
324
|
+
<a href="#register-class_method" title="register (class method)">.<strong>register</strong>(name, *args, &block) ⇒ Object </a>
|
325
|
+
|
326
|
+
|
327
|
+
|
328
|
+
</span>
|
329
|
+
|
330
|
+
|
331
|
+
|
332
|
+
|
333
|
+
|
334
|
+
|
335
|
+
|
336
|
+
|
337
|
+
|
338
|
+
<span class="summary_desc"><div class='inline'>
|
339
|
+
<p>Reserve instance generation.</p>
|
340
|
+
</div></span>
|
341
|
+
|
342
|
+
</li>
|
343
|
+
|
344
|
+
|
345
|
+
</ul>
|
346
|
+
|
347
|
+
|
348
|
+
|
349
|
+
|
350
|
+
<div id="class_method_details" class="method_details_list">
|
351
|
+
<h2>Class Method Details</h2>
|
352
|
+
|
353
|
+
|
354
|
+
<div class="method_details first">
|
355
|
+
<h3 class="signature first" id="[]-class_method">
|
356
|
+
|
357
|
+
.<strong>[]</strong>(name) ⇒ <tt>Object</tt>
|
358
|
+
|
359
|
+
|
360
|
+
|
361
|
+
|
362
|
+
|
363
|
+
</h3><div class="docstring">
|
364
|
+
<div class="discussion">
|
365
|
+
|
366
|
+
<p>Return instance of loaded resource (call on subclasses)</p>
|
367
|
+
|
368
|
+
|
369
|
+
</div>
|
370
|
+
</div>
|
371
|
+
<div class="tags">
|
372
|
+
|
373
|
+
|
374
|
+
</div><table class="source_code">
|
375
|
+
<tr>
|
376
|
+
<td>
|
377
|
+
<pre class="lines">
|
378
|
+
|
379
|
+
|
380
|
+
26
|
381
|
+
27
|
382
|
+
28
|
383
|
+
29
|
384
|
+
30
|
385
|
+
31
|
386
|
+
32</pre>
|
387
|
+
</td>
|
388
|
+
<td>
|
389
|
+
<pre class="code"><span class="info file"># File 'opal/dxopal/remote_resource.rb', line 26</span>
|
390
|
+
|
391
|
+
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='op'>[]</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span>
|
392
|
+
<span class='kw'>if</span> <span class='lparen'>(</span><span class='id identifier rubyid_ret'>ret</span> <span class='op'>=</span> <span class='cvar'>@@instances</span><span class='lbracket'>[</span><span class='id identifier rubyid__klass_name'>_klass_name</span><span class='rbracket'>]</span><span class='lbracket'>[</span><span class='id identifier rubyid_name'>name</span><span class='rbracket'>]</span><span class='rparen'>)</span>
|
393
|
+
<span class='kw'>return</span> <span class='id identifier rubyid_ret'>ret</span>
|
394
|
+
<span class='kw'>else</span>
|
395
|
+
<span class='id identifier rubyid_raise'>raise</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid__klass_name'>_klass_name</span><span class='embexpr_end'>}</span><span class='tstring_content'> </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_name'>name</span><span class='period'>.</span><span class='id identifier rubyid_inspect'>inspect</span><span class='embexpr_end'>}</span><span class='tstring_content'> is not registered</span><span class='tstring_end'>"</span></span>
|
396
|
+
<span class='kw'>end</span>
|
397
|
+
<span class='kw'>end</span></pre>
|
398
|
+
</td>
|
399
|
+
</tr>
|
400
|
+
</table>
|
401
|
+
</div>
|
402
|
+
|
403
|
+
<div class="method_details ">
|
404
|
+
<h3 class="signature " id="_klass_name-class_method">
|
405
|
+
|
406
|
+
.<strong>_klass_name</strong> ⇒ <tt>Object</tt>
|
407
|
+
|
408
|
+
|
409
|
+
|
410
|
+
|
411
|
+
|
412
|
+
</h3><div class="docstring">
|
413
|
+
<div class="discussion">
|
414
|
+
|
415
|
+
<p>Return a string like “Image” or “Sound”</p>
|
416
|
+
|
417
|
+
|
418
|
+
</div>
|
419
|
+
</div>
|
420
|
+
<div class="tags">
|
421
|
+
|
422
|
+
|
423
|
+
</div><table class="source_code">
|
424
|
+
<tr>
|
425
|
+
<td>
|
426
|
+
<pre class="lines">
|
427
|
+
|
428
|
+
|
429
|
+
61
|
430
|
+
62
|
431
|
+
63</pre>
|
432
|
+
</td>
|
433
|
+
<td>
|
434
|
+
<pre class="code"><span class="info file"># File 'opal/dxopal/remote_resource.rb', line 61</span>
|
435
|
+
|
436
|
+
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid__klass_name'>_klass_name</span>
|
437
|
+
<span class='kw'>return</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_name'>name</span><span class='period'>.</span><span class='id identifier rubyid_split'>split</span><span class='lparen'>(</span><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>::</span><span class='regexp_end'>/</span></span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_last'>last</span>
|
438
|
+
<span class='kw'>end</span></pre>
|
439
|
+
</td>
|
440
|
+
</tr>
|
441
|
+
</table>
|
442
|
+
</div>
|
443
|
+
|
444
|
+
<div class="method_details ">
|
445
|
+
<h3 class="signature " id="_load-class_method">
|
446
|
+
|
447
|
+
.<strong>_load</strong>(*args) ⇒ <tt>Object</tt>
|
448
|
+
|
449
|
+
|
450
|
+
|
451
|
+
|
452
|
+
|
453
|
+
</h3><div class="docstring">
|
454
|
+
<div class="discussion">
|
455
|
+
|
456
|
+
<p>Load actual content (defined on subclasses) Return `[instance, promise]`</p>
|
457
|
+
|
458
|
+
|
459
|
+
</div>
|
460
|
+
</div>
|
461
|
+
<div class="tags">
|
462
|
+
|
463
|
+
|
464
|
+
</div><table class="source_code">
|
465
|
+
<tr>
|
466
|
+
<td>
|
467
|
+
<pre class="lines">
|
468
|
+
|
469
|
+
|
470
|
+
56
|
471
|
+
57
|
472
|
+
58</pre>
|
473
|
+
</td>
|
474
|
+
<td>
|
475
|
+
<pre class="code"><span class="info file"># File 'opal/dxopal/remote_resource.rb', line 56</span>
|
476
|
+
|
477
|
+
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid__load'>_load</span><span class='lparen'>(</span><span class='op'>*</span><span class='id identifier rubyid_args'>args</span><span class='rparen'>)</span>
|
478
|
+
<span class='id identifier rubyid_raise'>raise</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>override me</span><span class='tstring_end'>"</span></span>
|
479
|
+
<span class='kw'>end</span></pre>
|
480
|
+
</td>
|
481
|
+
</tr>
|
482
|
+
</table>
|
483
|
+
</div>
|
484
|
+
|
485
|
+
<div class="method_details ">
|
486
|
+
<h3 class="signature " id="_load_resources-class_method">
|
487
|
+
|
488
|
+
.<strong>_load_resources</strong>(&block) ⇒ <tt>Object</tt>
|
489
|
+
|
490
|
+
|
491
|
+
|
492
|
+
|
493
|
+
|
494
|
+
</h3><div class="docstring">
|
495
|
+
<div class="discussion">
|
496
|
+
|
497
|
+
<p>Called from Window.load_resources</p>
|
498
|
+
|
499
|
+
|
500
|
+
</div>
|
501
|
+
</div>
|
502
|
+
<div class="tags">
|
503
|
+
|
504
|
+
|
505
|
+
</div><table class="source_code">
|
506
|
+
<tr>
|
507
|
+
<td>
|
508
|
+
<pre class="lines">
|
509
|
+
|
510
|
+
|
511
|
+
35
|
512
|
+
36
|
513
|
+
37
|
514
|
+
38
|
515
|
+
39
|
516
|
+
40
|
517
|
+
41
|
518
|
+
42
|
519
|
+
43
|
520
|
+
44
|
521
|
+
45
|
522
|
+
46
|
523
|
+
47
|
524
|
+
48
|
525
|
+
49
|
526
|
+
50
|
527
|
+
51
|
528
|
+
52</pre>
|
529
|
+
</td>
|
530
|
+
<td>
|
531
|
+
<pre class="code"><span class="info file"># File 'opal/dxopal/remote_resource.rb', line 35</span>
|
532
|
+
|
533
|
+
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid__load_resources'>_load_resources</span><span class='lparen'>(</span><span class='op'>&</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
|
534
|
+
<span class='cvar'>@@resources</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_klass_name'>klass_name</span><span class='comma'>,</span> <span class='id identifier rubyid_items'>items</span><span class='op'>|</span>
|
535
|
+
<span class='id identifier rubyid_klass'>klass</span> <span class='op'>=</span> <span class='cvar'>@@klasses</span><span class='lbracket'>[</span><span class='id identifier rubyid_klass_name'>klass_name</span><span class='rbracket'>]</span>
|
536
|
+
<span class='id identifier rubyid_items'>items</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_name'>name</span><span class='comma'>,</span> <span class='lparen'>(</span><span class='id identifier rubyid_block'>block</span><span class='comma'>,</span> <span class='id identifier rubyid_args'>args</span><span class='rparen'>)</span><span class='op'>|</span>
|
537
|
+
<span class='kw'>if</span> <span class='op'>!</span><span class='cvar'>@@promises</span><span class='lbracket'>[</span><span class='id identifier rubyid_klass_name'>klass_name</span><span class='rbracket'>]</span><span class='lbracket'>[</span><span class='id identifier rubyid_name'>name</span><span class='rbracket'>]</span>
|
538
|
+
<span class='id identifier rubyid_instance'>instance</span><span class='comma'>,</span> <span class='id identifier rubyid_promise'>promise</span> <span class='op'>=</span> <span class='id identifier rubyid_klass'>klass</span><span class='period'>.</span><span class='id identifier rubyid__load'>_load</span><span class='lparen'>(</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>
|
539
|
+
<span class='cvar'>@@instances</span><span class='lbracket'>[</span><span class='id identifier rubyid_klass_name'>klass_name</span><span class='rbracket'>]</span><span class='lbracket'>[</span><span class='id identifier rubyid_name'>name</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_instance'>instance</span>
|
540
|
+
<span class='cvar'>@@promises</span><span class='lbracket'>[</span><span class='id identifier rubyid_klass_name'>klass_name</span><span class='rbracket'>]</span><span class='lbracket'>[</span><span class='id identifier rubyid_name'>name</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_promise'>promise</span>
|
541
|
+
<span class='kw'>end</span>
|
542
|
+
<span class='kw'>end</span>
|
543
|
+
<span class='kw'>end</span>
|
544
|
+
<span class='id identifier rubyid_promises'>promises</span> <span class='op'>=</span> <span class='cvar'>@@promises</span><span class='period'>.</span><span class='id identifier rubyid_values'>values</span><span class='period'>.</span><span class='id identifier rubyid_flat_map'>flat_map</span><span class='lparen'>(</span><span class='op'>&</span><span class='symbol'>:values</span><span class='rparen'>)</span>
|
545
|
+
<span class='backtick'>%x{</span><span class='tstring_content'>
|
546
|
+
Promise.all(</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_promises'>promises</span><span class='embexpr_end'>}</span><span class='tstring_content'>).then(function() {
|
547
|
+
</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_block'>block</span><span class='period'>.</span><span class='id identifier rubyid_call'>call</span><span class='embexpr_end'>}</span><span class='tstring_content'>
|
548
|
+
});
|
549
|
+
</span><span class='tstring_end'>}</span></span>
|
550
|
+
<span class='kw'>end</span></pre>
|
551
|
+
</td>
|
552
|
+
</tr>
|
553
|
+
</table>
|
554
|
+
</div>
|
555
|
+
|
556
|
+
<div class="method_details ">
|
557
|
+
<h3 class="signature " id="add_class-class_method">
|
558
|
+
|
559
|
+
.<strong>add_class</strong>(subklass) ⇒ <tt>Object</tt>
|
560
|
+
|
561
|
+
|
562
|
+
|
563
|
+
|
564
|
+
|
565
|
+
</h3><table class="source_code">
|
566
|
+
<tr>
|
567
|
+
<td>
|
568
|
+
<pre class="lines">
|
569
|
+
|
570
|
+
|
571
|
+
15
|
572
|
+
16
|
573
|
+
17</pre>
|
574
|
+
</td>
|
575
|
+
<td>
|
576
|
+
<pre class="code"><span class="info file"># File 'opal/dxopal/remote_resource.rb', line 15</span>
|
577
|
+
|
578
|
+
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_add_class'>add_class</span><span class='lparen'>(</span><span class='id identifier rubyid_subklass'>subklass</span><span class='rparen'>)</span>
|
579
|
+
<span class='cvar'>@@klasses</span><span class='lbracket'>[</span><span class='id identifier rubyid_subklass'>subklass</span><span class='period'>.</span><span class='id identifier rubyid__klass_name'>_klass_name</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_subklass'>subklass</span>
|
580
|
+
<span class='kw'>end</span></pre>
|
581
|
+
</td>
|
582
|
+
</tr>
|
583
|
+
</table>
|
584
|
+
</div>
|
585
|
+
|
586
|
+
<div class="method_details ">
|
587
|
+
<h3 class="signature " id="register-class_method">
|
588
|
+
|
589
|
+
.<strong>register</strong>(name, *args, &block) ⇒ <tt>Object</tt>
|
590
|
+
|
591
|
+
|
592
|
+
|
593
|
+
|
594
|
+
|
595
|
+
</h3><div class="docstring">
|
596
|
+
<div class="discussion">
|
597
|
+
|
598
|
+
<p>Reserve instance generation</p>
|
599
|
+
|
600
|
+
|
601
|
+
</div>
|
602
|
+
</div>
|
603
|
+
<div class="tags">
|
604
|
+
|
605
|
+
|
606
|
+
</div><table class="source_code">
|
607
|
+
<tr>
|
608
|
+
<td>
|
609
|
+
<pre class="lines">
|
610
|
+
|
611
|
+
|
612
|
+
20
|
613
|
+
21
|
614
|
+
22
|
615
|
+
23</pre>
|
616
|
+
</td>
|
617
|
+
<td>
|
618
|
+
<pre class="code"><span class="info file"># File 'opal/dxopal/remote_resource.rb', line 20</span>
|
619
|
+
|
620
|
+
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_register'>register</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</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>
|
621
|
+
<span class='cvar'>@@resources</span><span class='lbracket'>[</span><span class='id identifier rubyid__klass_name'>_klass_name</span><span class='rbracket'>]</span> <span class='op'>||=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
|
622
|
+
<span class='cvar'>@@resources</span><span class='lbracket'>[</span><span class='id identifier rubyid__klass_name'>_klass_name</span><span class='rbracket'>]</span><span class='lbracket'>[</span><span class='id identifier rubyid_name'>name</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='id identifier rubyid_block'>block</span><span class='comma'>,</span> <span class='id identifier rubyid_args'>args</span><span class='rbracket'>]</span>
|
623
|
+
<span class='kw'>end</span></pre>
|
624
|
+
</td>
|
625
|
+
</tr>
|
626
|
+
</table>
|
627
|
+
</div>
|
628
|
+
|
629
|
+
</div>
|
630
|
+
|
631
|
+
</div>
|
632
|
+
|
633
|
+
<div id="footer">
|
634
|
+
Generated on Tue Oct 17 13:56:28 2017 by
|
635
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
636
|
+
0.9.9 (ruby-2.4.2).
|
637
|
+
</div>
|
638
|
+
|
639
|
+
</div>
|
640
|
+
</body>
|
641
|
+
</html>
|