rumai 2.0.2 → 2.1.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.
Files changed (167) hide show
  1. data/CREDITS +2 -0
  2. data/bin/rumai +20 -8
  3. data/doc/api/classes/IO.html +72 -0
  4. data/doc/api/classes/Integer.html +110 -0
  5. data/doc/api/classes/Object.html +60 -0
  6. data/doc/api/classes/Rumai.html +867 -0
  7. data/doc/api/classes/Rumai/Area.html +836 -0
  8. data/doc/api/classes/Rumai/Chain.html +197 -0
  9. data/doc/api/classes/Rumai/Client.html +865 -0
  10. data/doc/api/classes/Rumai/ClientContainer.html +191 -0
  11. data/doc/api/classes/Rumai/ExportInstanceMethods.html +69 -0
  12. data/doc/api/classes/Rumai/IXP.html +131 -0
  13. data/doc/api/classes/Rumai/IXP/Agent.html +836 -0
  14. data/doc/api/classes/Rumai/IXP/Agent/FidStream.html +456 -0
  15. data/doc/api/classes/Rumai/IXP/Agent/MODES.html +108 -0
  16. data/doc/api/classes/Rumai/IXP/Agent/RangedPool.html +241 -0
  17. data/doc/api/classes/Rumai/IXP/Error.html +67 -0
  18. data/doc/api/classes/Rumai/IXP/Fcall.html +323 -0
  19. data/doc/api/classes/Rumai/IXP/Qid.html +153 -0
  20. data/doc/api/classes/Rumai/IXP/Rattach.html +67 -0
  21. data/doc/api/classes/Rumai/IXP/Rauth.html +67 -0
  22. data/doc/api/classes/Rumai/IXP/Rclunk.html +67 -0
  23. data/doc/api/classes/Rumai/IXP/Rcreate.html +67 -0
  24. data/doc/api/classes/Rumai/IXP/Rerror.html +67 -0
  25. data/doc/api/classes/Rumai/IXP/Rflush.html +67 -0
  26. data/doc/api/classes/Rumai/IXP/Ropen.html +67 -0
  27. data/doc/api/classes/Rumai/IXP/Rread.html +67 -0
  28. data/doc/api/classes/Rumai/IXP/Rremove.html +67 -0
  29. data/doc/api/classes/Rumai/IXP/Rstat.html +67 -0
  30. data/doc/api/classes/Rumai/IXP/Rversion.html +67 -0
  31. data/doc/api/classes/Rumai/IXP/Rwalk.html +67 -0
  32. data/doc/api/classes/Rumai/IXP/Rwrite.html +67 -0
  33. data/doc/api/classes/Rumai/IXP/Rwstat.html +67 -0
  34. data/doc/api/classes/Rumai/IXP/Stat.html +252 -0
  35. data/doc/api/classes/Rumai/IXP/Stream.html +131 -0
  36. data/doc/api/classes/Rumai/IXP/Struct.html +315 -0
  37. data/doc/api/classes/Rumai/IXP/Struct/Field.html +415 -0
  38. data/doc/api/classes/Rumai/IXP/Struct/Field/CounteeField.html +153 -0
  39. data/doc/api/classes/Rumai/IXP/Struct/Field/CounterField.html +104 -0
  40. data/doc/api/classes/Rumai/IXP/Tattach.html +68 -0
  41. data/doc/api/classes/Rumai/IXP/Tauth.html +67 -0
  42. data/doc/api/classes/Rumai/IXP/Tclunk.html +67 -0
  43. data/doc/api/classes/Rumai/IXP/Tcreate.html +68 -0
  44. data/doc/api/classes/Rumai/IXP/Terror.html +110 -0
  45. data/doc/api/classes/Rumai/IXP/Tflush.html +67 -0
  46. data/doc/api/classes/Rumai/IXP/Topen.html +165 -0
  47. data/doc/api/classes/Rumai/IXP/Tread.html +67 -0
  48. data/doc/api/classes/Rumai/IXP/Tremove.html +67 -0
  49. data/doc/api/classes/Rumai/IXP/Tstat.html +67 -0
  50. data/doc/api/classes/Rumai/IXP/Tversion.html +86 -0
  51. data/doc/api/classes/Rumai/IXP/Twalk.html +68 -0
  52. data/doc/api/classes/Rumai/IXP/Twrite.html +68 -0
  53. data/doc/api/classes/Rumai/IXP/Twstat.html +67 -0
  54. data/doc/api/classes/Rumai/Node.html +817 -0
  55. data/doc/api/classes/Rumai/View.html +818 -0
  56. data/doc/api/classes/Rumai/WidgetImpl.html +65 -0
  57. data/doc/api/classes/Rumai/WidgetNode.html +68 -0
  58. data/doc/api/classes/String.html +163 -0
  59. data/doc/api/classes/StringIO.html +72 -0
  60. data/doc/api/classes/Time.html +156 -0
  61. data/doc/api/created.rid +1 -0
  62. data/doc/api/css/main.css +263 -0
  63. data/doc/api/css/panel.css +383 -0
  64. data/doc/api/css/reset.css +53 -0
  65. data/doc/api/files/CREDITS.html +64 -0
  66. data/doc/api/files/LICENSE.html +76 -0
  67. data/doc/api/files/lib/rumai/fs_rb.html +75 -0
  68. data/doc/api/files/lib/rumai/ixp/message_rb.html +91 -0
  69. data/doc/api/files/lib/rumai/ixp/transport_rb.html +75 -0
  70. data/doc/api/files/lib/rumai/ixp_rb.html +69 -0
  71. data/doc/api/files/lib/rumai/wm_rb.html +77 -0
  72. data/doc/api/files/lib/rumai_rb.html +65 -0
  73. data/doc/api/i/arrows.png +0 -0
  74. data/doc/api/i/results_bg.png +0 -0
  75. data/doc/api/i/tree_bg.png +0 -0
  76. data/doc/api/index.html +14 -18
  77. data/doc/api/js/jquery-1.3.2.min.js +19 -0
  78. data/doc/api/js/jquery-effect.js +593 -0
  79. data/doc/api/js/main.js +22 -0
  80. data/doc/api/js/searchdoc.js +605 -0
  81. data/doc/api/panel/index.html +63 -0
  82. data/doc/api/panel/search_index.js +1 -0
  83. data/doc/api/panel/tree.js +1 -0
  84. data/doc/history.erb +41 -16
  85. data/doc/index.erb +14 -11
  86. data/doc/index.xhtml +519 -846
  87. data/doc/intro.erb +33 -32
  88. data/doc/setup.erb +14 -13
  89. data/doc/usage.erb +69 -35
  90. data/lib/rumai.rb +13 -5
  91. data/lib/rumai/fs.rb +71 -27
  92. data/lib/rumai/ixp.rb +4 -0
  93. data/lib/rumai/ixp/message.rb +178 -81
  94. data/lib/rumai/ixp/transport.rb +144 -91
  95. data/lib/rumai/wm.rb +717 -593
  96. data/rakefile +14 -0
  97. data/test/rumai/ixp/message.rb +42 -54
  98. metadata +110 -89
  99. data/Rakefile +0 -8
  100. data/doc/api/IO.html +0 -53
  101. data/doc/api/Integer.html +0 -102
  102. data/doc/api/Object.html +0 -23
  103. data/doc/api/Rumai.html +0 -1218
  104. data/doc/api/Rumai/Area.html +0 -1088
  105. data/doc/api/Rumai/Chain.html +0 -230
  106. data/doc/api/Rumai/Client.html +0 -1264
  107. data/doc/api/Rumai/ClientContainer.html +0 -227
  108. data/doc/api/Rumai/ExportInstMethods.html +0 -115
  109. data/doc/api/Rumai/IXP.html +0 -23
  110. data/doc/api/Rumai/IXP/Agent.html +0 -1222
  111. data/doc/api/Rumai/IXP/Agent/FidStream.html +0 -602
  112. data/doc/api/Rumai/IXP/Agent/RangedPool.html +0 -263
  113. data/doc/api/Rumai/IXP/Error.html +0 -32
  114. data/doc/api/Rumai/IXP/Fcall.html +0 -398
  115. data/doc/api/Rumai/IXP/Qid.html +0 -99
  116. data/doc/api/Rumai/IXP/Rattach.html +0 -71
  117. data/doc/api/Rumai/IXP/Rauth.html +0 -71
  118. data/doc/api/Rumai/IXP/Rclunk.html +0 -71
  119. data/doc/api/Rumai/IXP/Rcreate.html +0 -71
  120. data/doc/api/Rumai/IXP/Rerror.html +0 -71
  121. data/doc/api/Rumai/IXP/Rflush.html +0 -71
  122. data/doc/api/Rumai/IXP/Ropen.html +0 -71
  123. data/doc/api/Rumai/IXP/Rread.html +0 -71
  124. data/doc/api/Rumai/IXP/Rremove.html +0 -71
  125. data/doc/api/Rumai/IXP/Rstat.html +0 -71
  126. data/doc/api/Rumai/IXP/Rversion.html +0 -71
  127. data/doc/api/Rumai/IXP/Rwalk.html +0 -71
  128. data/doc/api/Rumai/IXP/Rwrite.html +0 -71
  129. data/doc/api/Rumai/IXP/Rwstat.html +0 -71
  130. data/doc/api/Rumai/IXP/Stat.html +0 -188
  131. data/doc/api/Rumai/IXP/Stream.html +0 -112
  132. data/doc/api/Rumai/IXP/Struct.html +0 -348
  133. data/doc/api/Rumai/IXP/Struct/ClassField.html +0 -177
  134. data/doc/api/Rumai/IXP/Struct/Field.html +0 -549
  135. data/doc/api/Rumai/IXP/Struct/Field/CounteeField.html +0 -175
  136. data/doc/api/Rumai/IXP/Struct/Field/CounterField.html +0 -95
  137. data/doc/api/Rumai/IXP/Struct/Integer8Field.html +0 -181
  138. data/doc/api/Rumai/IXP/Struct/StringField.html +0 -128
  139. data/doc/api/Rumai/IXP/Tattach.html +0 -71
  140. data/doc/api/Rumai/IXP/Tauth.html +0 -71
  141. data/doc/api/Rumai/IXP/Tclunk.html +0 -71
  142. data/doc/api/Rumai/IXP/Tcreate.html +0 -71
  143. data/doc/api/Rumai/IXP/Terror.html +0 -156
  144. data/doc/api/Rumai/IXP/Tflush.html +0 -71
  145. data/doc/api/Rumai/IXP/Topen.html +0 -113
  146. data/doc/api/Rumai/IXP/Tread.html +0 -71
  147. data/doc/api/Rumai/IXP/Tremove.html +0 -71
  148. data/doc/api/Rumai/IXP/Tstat.html +0 -71
  149. data/doc/api/Rumai/IXP/Tversion.html +0 -83
  150. data/doc/api/Rumai/IXP/Twalk.html +0 -71
  151. data/doc/api/Rumai/IXP/Twrite.html +0 -71
  152. data/doc/api/Rumai/IXP/Twstat.html +0 -71
  153. data/doc/api/Rumai/Node.html +0 -1139
  154. data/doc/api/Rumai/View.html +0 -1280
  155. data/doc/api/Rumai/WidgetImpl.html +0 -196
  156. data/doc/api/Rumai/WidgetNode.html +0 -184
  157. data/doc/api/String.html +0 -180
  158. data/doc/api/StringIO.html +0 -53
  159. data/doc/api/Time.html +0 -175
  160. data/doc/api/all-methods.html +0 -1436
  161. data/doc/api/all-namespaces.html +0 -140
  162. data/doc/api/app.js +0 -18
  163. data/doc/api/jquery.js +0 -11
  164. data/doc/api/readme.html +0 -38
  165. data/doc/api/style.css +0 -68
  166. data/doc/api/syntax_highlight.css +0 -21
  167. data/doc/theory.erb +0 -3
@@ -0,0 +1,315 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
3
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
4
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
5
+ <head>
6
+ <title>Rumai::IXP::Struct</title>
7
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
8
+ <link rel="stylesheet" href="../../../css/reset.css" type="text/css" media="screen" />
9
+ <link rel="stylesheet" href="../../../css/main.css" type="text/css" media="screen" />
10
+ <script src="../../../js/jquery-1.3.2.min.js" type="text/javascript" charset="utf-8"></script>
11
+ <script src="../../../js/jquery-effect.js" type="text/javascript" charset="utf-8"></script>
12
+ <script src="../../../js/main.js" type="text/javascript" charset="utf-8"></script>
13
+ </head>
14
+
15
+ <body>
16
+ <div class="banner">
17
+ <h1>
18
+ <span class="type">Module</span>
19
+ Rumai::IXP::Struct
20
+
21
+ </h1>
22
+ <ul class="files">
23
+
24
+ <li><a href="../../../files/lib/rumai/ixp/message_rb.html">lib/rumai/ixp/message.rb</a></li>
25
+
26
+ </ul>
27
+ </div>
28
+ <div id="bodyContent">
29
+ <div id="content">
30
+
31
+ <div class="description">
32
+ <p>
33
+ A serializable 9P2000 data structure.
34
+ </p>
35
+
36
+ </div>
37
+
38
+
39
+
40
+
41
+
42
+
43
+
44
+
45
+
46
+ <div class="sectiontitle">Methods</div>
47
+ <dl class="methods">
48
+
49
+ <dt>I</dt>
50
+ <dd>
51
+ <ul>
52
+
53
+ <li><a href="#M000132">included</a></li>
54
+
55
+ </ul>
56
+ </dd>
57
+
58
+ <dt>L</dt>
59
+ <dd>
60
+ <ul>
61
+
62
+ <li><a href="#M000131">load_9p</a></li>
63
+
64
+ </ul>
65
+ </dd>
66
+
67
+ <dt>N</dt>
68
+ <dd>
69
+ <ul>
70
+
71
+ <li><a href="#M000129">new</a></li>
72
+
73
+ </ul>
74
+ </dd>
75
+
76
+ <dt>T</dt>
77
+ <dd>
78
+ <ul>
79
+
80
+ <li><a href="#M000130">to_9p</a></li>
81
+
82
+ </ul>
83
+ </dd>
84
+
85
+ </dl>
86
+
87
+
88
+
89
+
90
+
91
+
92
+
93
+ <div class="sectiontitle">Classes and Modules</div>
94
+ <ul>
95
+
96
+ <li><span class="type">CLASS</span> <a href="Struct/Field.html">Rumai::IXP::Struct::Field</a></li>
97
+
98
+ </ul>
99
+
100
+
101
+
102
+
103
+
104
+ <div class="sectiontitle">Attributes</div>
105
+ <table border='0' cellpadding='5'>
106
+
107
+ <tr valign='top'>
108
+ <td class='attr-rw'>
109
+ [R]
110
+ </td>
111
+ <td class='attr-name'>fields</td>
112
+ <td class='attr-desc'></td>
113
+ </tr>
114
+
115
+ </table>
116
+
117
+
118
+
119
+ <div class="sectiontitle">Class Public methods</div>
120
+
121
+ <div class="method">
122
+ <div class="title" id="M000132">
123
+
124
+ <a name="M000132"></a><b>included</b>(target)
125
+
126
+ </div>
127
+
128
+ <div class="description">
129
+ <p>
130
+ Provides a convenient DSL (for defining fields) to all objects which
131
+ <b>include</b> this module.
132
+ </p>
133
+
134
+ </div>
135
+
136
+
137
+
138
+
139
+ <div class="sourcecode">
140
+ <p class="source-link">
141
+ Source: <a href="javascript:toggleSource('M000132_source')" id="l_M000132_source">show</a>
142
+
143
+ | <a href="http://github.com/sunaku/rumai/blob/5fcf09b89976a53dd9346e335a1803b337e0c447/lib/rumai/ixp/message.rb#L86" target="_blank" class="github_url">on GitHub</a>
144
+
145
+ </p>
146
+ <div id="M000132_source" class="dyn-source">
147
+ <pre><span class="ruby-comment cmt"># File lib/rumai/ixp/message.rb, line 86</span>
148
+ <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">included</span> <span class="ruby-identifier">target</span>
149
+ <span class="ruby-keyword kw">class</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">target</span>
150
+ <span class="ruby-comment cmt"># Returns a list of fields which compose this Struct.</span>
151
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">fields</span>
152
+ <span class="ruby-ivar">@fields</span> <span class="ruby-operator">||=</span>
153
+ <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">superclass</span>.<span class="ruby-identifier">respond_to?</span> <span class="ruby-identifier">:fields</span>
154
+ <span class="ruby-identifier">superclass</span>.<span class="ruby-identifier">fields</span>.<span class="ruby-identifier">dup</span>
155
+ <span class="ruby-keyword kw">else</span>
156
+ []
157
+ <span class="ruby-keyword kw">end</span>
158
+ <span class="ruby-keyword kw">end</span>
159
+
160
+ <span class="ruby-comment cmt">##</span>
161
+ <span class="ruby-comment cmt"># Defines a new field in this Struct.</span>
162
+ <span class="ruby-comment cmt">#</span>
163
+ <span class="ruby-comment cmt"># [args] arguments for Field.new()</span>
164
+ <span class="ruby-comment cmt">#</span>
165
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">field</span> <span class="ruby-identifier">name</span>, <span class="ruby-identifier">format</span> = <span class="ruby-keyword kw">nil</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">args</span>
166
+ <span class="ruby-identifier">c</span> = <span class="ruby-constant">Field</span>.<span class="ruby-identifier">factory</span>(<span class="ruby-identifier">format</span>)
167
+ <span class="ruby-identifier">f</span> = <span class="ruby-identifier">c</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">name</span>.<span class="ruby-identifier">to_sym</span>, <span class="ruby-identifier">format</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">args</span>)
168
+ <span class="ruby-identifier">fields</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">f</span> <span class="ruby-comment cmt"># register field as being part of this structure</span>
169
+
170
+ <span class="ruby-comment cmt"># provide accessor methods to field values</span>
171
+ <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class_eval</span> <span class="ruby-node">%{
172
+ def #{f.name}
173
+ @values[#{f.name.inspect}]
174
+ end
175
+
176
+ def #{f.name}= value
177
+ @values[#{f.name.inspect}] = value
178
+ end
179
+ }</span>
180
+
181
+ <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">f</span>
182
+ <span class="ruby-keyword kw">end</span>
183
+
184
+ <span class="ruby-comment cmt">##</span>
185
+ <span class="ruby-comment cmt"># Creates a new instance of this class from the</span>
186
+ <span class="ruby-comment cmt"># given 9P2000 byte stream and returns the instance.</span>
187
+ <span class="ruby-comment cmt">#</span>
188
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">from_9p</span> <span class="ruby-identifier">stream</span>, <span class="ruby-identifier">msg_class</span> = <span class="ruby-keyword kw">self</span>
189
+ <span class="ruby-identifier">msg</span> = <span class="ruby-identifier">msg_class</span>.<span class="ruby-identifier">new</span>
190
+ <span class="ruby-identifier">msg</span>.<span class="ruby-identifier">load_9p</span>(<span class="ruby-identifier">stream</span>)
191
+ <span class="ruby-identifier">msg</span>
192
+ <span class="ruby-keyword kw">end</span>
193
+ <span class="ruby-keyword kw">end</span>
194
+ <span class="ruby-keyword kw">end</span></pre>
195
+ </div>
196
+ </div>
197
+
198
+ </div>
199
+
200
+ <div class="method">
201
+ <div class="title" id="M000129">
202
+
203
+ <a name="M000129"></a><b>new</b>(field_values = {})
204
+
205
+ </div>
206
+
207
+ <div class="description">
208
+ <p>
209
+ Allows field values to be initialized via the constructor.
210
+ </p>
211
+ <dl>
212
+ <dt>field_values</dt><dd>a mapping from field name to field value
213
+
214
+ </dd>
215
+ </dl>
216
+
217
+ </div>
218
+
219
+
220
+
221
+
222
+ <div class="sourcecode">
223
+ <p class="source-link">
224
+ Source: <a href="javascript:toggleSource('M000129_source')" id="l_M000129_source">show</a>
225
+
226
+ | <a href="http://github.com/sunaku/rumai/blob/5fcf09b89976a53dd9346e335a1803b337e0c447/lib/rumai/ixp/message.rb#L60" target="_blank" class="github_url">on GitHub</a>
227
+
228
+ </p>
229
+ <div id="M000129_source" class="dyn-source">
230
+ <pre><span class="ruby-comment cmt"># File lib/rumai/ixp/message.rb, line 60</span>
231
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span> <span class="ruby-identifier">field_values</span> = {}
232
+ <span class="ruby-ivar">@fields</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">fields</span>
233
+ <span class="ruby-ivar">@values</span> = <span class="ruby-identifier">field_values</span>
234
+ <span class="ruby-keyword kw">end</span></pre>
235
+ </div>
236
+ </div>
237
+
238
+ </div>
239
+
240
+ <div class="sectiontitle">Instance Public methods</div>
241
+
242
+ <div class="method">
243
+ <div class="title" id="M000131">
244
+
245
+ <a name="M000131"></a><b>load_9p</b>(stream)
246
+
247
+ </div>
248
+
249
+ <div class="description">
250
+ <p>
251
+ Populates this object with information from the given 9P2000 byte stream.
252
+ </p>
253
+
254
+ </div>
255
+
256
+
257
+
258
+
259
+ <div class="sourcecode">
260
+ <p class="source-link">
261
+ Source: <a href="javascript:toggleSource('M000131_source')" id="l_M000131_source">show</a>
262
+
263
+ | <a href="http://github.com/sunaku/rumai/blob/5fcf09b89976a53dd9346e335a1803b337e0c447/lib/rumai/ixp/message.rb#L76" target="_blank" class="github_url">on GitHub</a>
264
+
265
+ </p>
266
+ <div id="M000131_source" class="dyn-source">
267
+ <pre><span class="ruby-comment cmt"># File lib/rumai/ixp/message.rb, line 76</span>
268
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">load_9p</span> <span class="ruby-identifier">stream</span>
269
+ <span class="ruby-ivar">@fields</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">f</span><span class="ruby-operator">|</span>
270
+ <span class="ruby-identifier">f</span>.<span class="ruby-identifier">load_9p</span> <span class="ruby-identifier">stream</span>, <span class="ruby-ivar">@values</span>
271
+ <span class="ruby-keyword kw">end</span>
272
+ <span class="ruby-keyword kw">end</span></pre>
273
+ </div>
274
+ </div>
275
+
276
+ </div>
277
+
278
+ <div class="method">
279
+ <div class="title" id="M000130">
280
+
281
+ <a name="M000130"></a><b>to_9p</b>()
282
+
283
+ </div>
284
+
285
+ <div class="description">
286
+ <p>
287
+ Transforms this object into a string of 9P2000 bytes.
288
+ </p>
289
+
290
+ </div>
291
+
292
+
293
+
294
+
295
+ <div class="sourcecode">
296
+ <p class="source-link">
297
+ Source: <a href="javascript:toggleSource('M000130_source')" id="l_M000130_source">show</a>
298
+
299
+ | <a href="http://github.com/sunaku/rumai/blob/5fcf09b89976a53dd9346e335a1803b337e0c447/lib/rumai/ixp/message.rb#L68" target="_blank" class="github_url">on GitHub</a>
300
+
301
+ </p>
302
+ <div id="M000130_source" class="dyn-source">
303
+ <pre><span class="ruby-comment cmt"># File lib/rumai/ixp/message.rb, line 68</span>
304
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_9p</span>
305
+ <span class="ruby-ivar">@fields</span>.<span class="ruby-identifier">inject</span>(<span class="ruby-value str">''</span>) {<span class="ruby-operator">|</span><span class="ruby-identifier">s</span>,<span class="ruby-identifier">f</span><span class="ruby-operator">|</span> <span class="ruby-identifier">s</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">f</span>.<span class="ruby-identifier">to_9p</span>(<span class="ruby-ivar">@values</span>) }
306
+ <span class="ruby-keyword kw">end</span></pre>
307
+ </div>
308
+ </div>
309
+
310
+ </div>
311
+
312
+ </div>
313
+ </div>
314
+ </body>
315
+ </html>
@@ -0,0 +1,415 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
3
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
4
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
5
+ <head>
6
+ <title>Rumai::IXP::Struct::Field</title>
7
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
8
+ <link rel="stylesheet" href="../../../../css/reset.css" type="text/css" media="screen" />
9
+ <link rel="stylesheet" href="../../../../css/main.css" type="text/css" media="screen" />
10
+ <script src="../../../../js/jquery-1.3.2.min.js" type="text/javascript" charset="utf-8"></script>
11
+ <script src="../../../../js/jquery-effect.js" type="text/javascript" charset="utf-8"></script>
12
+ <script src="../../../../js/main.js" type="text/javascript" charset="utf-8"></script>
13
+ </head>
14
+
15
+ <body>
16
+ <div class="banner">
17
+ <h1>
18
+ <span class="type">Class</span>
19
+ Rumai::IXP::Struct::Field
20
+
21
+ <span class="parent">&lt;
22
+
23
+ <a href="../../../Object.html">Object</a>
24
+
25
+ </span>
26
+
27
+ </h1>
28
+ <ul class="files">
29
+
30
+ <li><a href="../../../../files/lib/rumai/ixp/message_rb.html">lib/rumai/ixp/message.rb</a></li>
31
+
32
+ </ul>
33
+ </div>
34
+ <div id="bodyContent">
35
+ <div id="content">
36
+
37
+ <div class="description">
38
+ <p>
39
+ A field inside a <a href="../Struct.html">Struct</a>.
40
+ </p>
41
+ <p>
42
+ A field&#8217;s value is considered to be either:
43
+ </p>
44
+ <ul>
45
+ <li>array of format when <tt>counter &amp;&amp; format.is_a? Class</tt>
46
+
47
+ </li>
48
+ <li>raw byte string when <tt>counter &amp;&amp; format.nil?</tt>
49
+
50
+ </li>
51
+ </ul>
52
+
53
+ </div>
54
+
55
+
56
+
57
+
58
+
59
+
60
+
61
+
62
+
63
+ <div class="sectiontitle">Methods</div>
64
+ <dl class="methods">
65
+
66
+ <dt>C</dt>
67
+ <dd>
68
+ <ul>
69
+
70
+ <li><a href="#M000138">countee=</a>,</li>
71
+
72
+ <li><a href="#M000137">counter=</a></li>
73
+
74
+ </ul>
75
+ </dd>
76
+
77
+ <dt>F</dt>
78
+ <dd>
79
+ <ul>
80
+
81
+ <li><a href="#M000139">factory</a></li>
82
+
83
+ </ul>
84
+ </dd>
85
+
86
+ <dt>L</dt>
87
+ <dd>
88
+ <ul>
89
+
90
+ <li><a href="#M000141">load_9p</a></li>
91
+
92
+ </ul>
93
+ </dd>
94
+
95
+ <dt>N</dt>
96
+ <dd>
97
+ <ul>
98
+
99
+ <li><a href="#M000136">new</a></li>
100
+
101
+ </ul>
102
+ </dd>
103
+
104
+ <dt>T</dt>
105
+ <dd>
106
+ <ul>
107
+
108
+ <li><a href="#M000140">to_9p</a></li>
109
+
110
+ </ul>
111
+ </dd>
112
+
113
+ </dl>
114
+
115
+
116
+
117
+
118
+
119
+
120
+
121
+ <div class="sectiontitle">Classes and Modules</div>
122
+ <ul>
123
+
124
+ <li><span class="type">MODULE</span> <a href="Field/CounteeField.html">Rumai::IXP::Struct::Field::CounteeField</a></li>
125
+
126
+ <li><span class="type">MODULE</span> <a href="Field/CounterField.html">Rumai::IXP::Struct::Field::CounterField</a></li>
127
+
128
+ </ul>
129
+
130
+
131
+
132
+
133
+
134
+ <div class="sectiontitle">Attributes</div>
135
+ <table border='0' cellpadding='5'>
136
+
137
+ <tr valign='top'>
138
+ <td class='attr-rw'>
139
+ [R]
140
+ </td>
141
+ <td class='attr-name'>name</td>
142
+ <td class='attr-desc'></td>
143
+ </tr>
144
+
145
+ <tr valign='top'>
146
+ <td class='attr-rw'>
147
+ [R]
148
+ </td>
149
+ <td class='attr-name'>format</td>
150
+ <td class='attr-desc'></td>
151
+ </tr>
152
+
153
+ <tr valign='top'>
154
+ <td class='attr-rw'>
155
+ [R]
156
+ </td>
157
+ <td class='attr-name'>counter</td>
158
+ <td class='attr-desc'></td>
159
+ </tr>
160
+
161
+ <tr valign='top'>
162
+ <td class='attr-rw'>
163
+ [R]
164
+ </td>
165
+ <td class='attr-name'>countee</td>
166
+ <td class='attr-desc'></td>
167
+ </tr>
168
+
169
+ </table>
170
+
171
+
172
+
173
+ <div class="sectiontitle">Class Public methods</div>
174
+
175
+ <div class="method">
176
+ <div class="title" id="M000139">
177
+
178
+ <a name="M000139"></a><b>factory</b>(format)
179
+
180
+ </div>
181
+
182
+ <div class="description">
183
+ <p>
184
+ Returns a <a href="Field.html">Field</a> class that best represents the
185
+ given format.
186
+ </p>
187
+
188
+ </div>
189
+
190
+
191
+
192
+
193
+ <div class="sourcecode">
194
+ <p class="source-link">
195
+ Source: <a href="javascript:toggleSource('M000139_source')" id="l_M000139_source">show</a>
196
+
197
+ | <a href="http://github.com/sunaku/rumai/blob/5fcf09b89976a53dd9346e335a1803b337e0c447/lib/rumai/ixp/message.rb#L187" target="_blank" class="github_url">on GitHub</a>
198
+
199
+ </p>
200
+ <div id="M000139_source" class="dyn-source">
201
+ <pre><span class="ruby-comment cmt"># File lib/rumai/ixp/message.rb, line 187</span>
202
+ <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">factory</span> <span class="ruby-identifier">format</span>
203
+ <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">format</span> <span class="ruby-operator">==</span> <span class="ruby-constant">String</span>
204
+ <span class="ruby-constant">StringField</span>
205
+
206
+ <span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">format</span>.<span class="ruby-identifier">is_a?</span> <span class="ruby-constant">Class</span>
207
+ <span class="ruby-constant">ClassField</span>
208
+
209
+ <span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">format</span> <span class="ruby-operator">==</span> <span class="ruby-value">8</span>
210
+ <span class="ruby-constant">Integer8Field</span>
211
+
212
+ <span class="ruby-keyword kw">else</span>
213
+ <span class="ruby-constant">Field</span>
214
+ <span class="ruby-keyword kw">end</span>
215
+ <span class="ruby-keyword kw">end</span></pre>
216
+ </div>
217
+ </div>
218
+
219
+ </div>
220
+
221
+ <div class="method">
222
+ <div class="title" id="M000136">
223
+
224
+ <a name="M000136"></a><b>new</b>(name, format = nil, counter = nil)
225
+
226
+ </div>
227
+
228
+ <div class="description">
229
+ <dl>
230
+ <dt>name</dt><dd>unique (among all fields in a struct) name for the field
231
+
232
+ </dd>
233
+ <dt>format</dt><dd>number of bytes, a class, or nil
234
+
235
+ </dd>
236
+ <dt>counter</dt><dd>field which counts the length of this field&#8217;s value
237
+
238
+ </dd>
239
+ </dl>
240
+
241
+ </div>
242
+
243
+
244
+
245
+
246
+ <div class="sourcecode">
247
+ <p class="source-link">
248
+ Source: <a href="javascript:toggleSource('M000136_source')" id="l_M000136_source">show</a>
249
+
250
+ | <a href="http://github.com/sunaku/rumai/blob/5fcf09b89976a53dd9346e335a1803b337e0c447/lib/rumai/ixp/message.rb#L156" target="_blank" class="github_url">on GitHub</a>
251
+
252
+ </p>
253
+ <div id="M000136_source" class="dyn-source">
254
+ <pre><span class="ruby-comment cmt"># File lib/rumai/ixp/message.rb, line 156</span>
255
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span> <span class="ruby-identifier">name</span>, <span class="ruby-identifier">format</span> = <span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">counter</span> = <span class="ruby-keyword kw">nil</span>
256
+ <span class="ruby-ivar">@name</span> = <span class="ruby-identifier">name</span>
257
+ <span class="ruby-ivar">@format</span> = <span class="ruby-identifier">format</span>
258
+ <span class="ruby-ivar">@countee</span> = <span class="ruby-keyword kw">nil</span>
259
+ <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">counter</span> = <span class="ruby-identifier">counter</span>
260
+ <span class="ruby-keyword kw">end</span></pre>
261
+ </div>
262
+ </div>
263
+
264
+ </div>
265
+
266
+ <div class="sectiontitle">Instance Public methods</div>
267
+
268
+ <div class="method">
269
+ <div class="title" id="M000138">
270
+
271
+ <a name="M000138"></a><b>countee=</b>(field)
272
+
273
+ </div>
274
+
275
+ <div class="description">
276
+ <p>
277
+ Sets the countee for this field (implying that this field counts the length
278
+ of the given field).
279
+ </p>
280
+
281
+ </div>
282
+
283
+
284
+
285
+
286
+ <div class="sourcecode">
287
+ <p class="source-link">
288
+ Source: <a href="javascript:toggleSource('M000138_source')" id="l_M000138_source">show</a>
289
+
290
+ | <a href="http://github.com/sunaku/rumai/blob/5fcf09b89976a53dd9346e335a1803b337e0c447/lib/rumai/ixp/message.rb#L178" target="_blank" class="github_url">on GitHub</a>
291
+
292
+ </p>
293
+ <div id="M000138_source" class="dyn-source">
294
+ <pre><span class="ruby-comment cmt"># File lib/rumai/ixp/message.rb, line 178</span>
295
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">countee=</span> <span class="ruby-identifier">field</span>
296
+ <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@countee</span> = <span class="ruby-identifier">field</span>
297
+ <span class="ruby-identifier">extend</span> <span class="ruby-constant">CounterField</span>
298
+ <span class="ruby-keyword kw">end</span>
299
+ <span class="ruby-keyword kw">end</span></pre>
300
+ </div>
301
+ </div>
302
+
303
+ </div>
304
+
305
+ <div class="method">
306
+ <div class="title" id="M000137">
307
+
308
+ <a name="M000137"></a><b>counter=</b>(field)
309
+
310
+ </div>
311
+
312
+ <div class="description">
313
+ <p>
314
+ Sets the counter for this field (implying that the length of this field is
315
+ counted by the given field).
316
+ </p>
317
+
318
+ </div>
319
+
320
+
321
+
322
+
323
+ <div class="sourcecode">
324
+ <p class="source-link">
325
+ Source: <a href="javascript:toggleSource('M000137_source')" id="l_M000137_source">show</a>
326
+
327
+ | <a href="http://github.com/sunaku/rumai/blob/5fcf09b89976a53dd9346e335a1803b337e0c447/lib/rumai/ixp/message.rb#L167" target="_blank" class="github_url">on GitHub</a>
328
+
329
+ </p>
330
+ <div id="M000137_source" class="dyn-source">
331
+ <pre><span class="ruby-comment cmt"># File lib/rumai/ixp/message.rb, line 167</span>
332
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">counter=</span> <span class="ruby-identifier">field</span>
333
+ <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@counter</span> = <span class="ruby-identifier">field</span>
334
+ <span class="ruby-identifier">extend</span> <span class="ruby-constant">CounteeField</span>
335
+ <span class="ruby-ivar">@counter</span>.<span class="ruby-identifier">countee</span> = <span class="ruby-keyword kw">self</span>
336
+ <span class="ruby-keyword kw">end</span>
337
+ <span class="ruby-keyword kw">end</span></pre>
338
+ </div>
339
+ </div>
340
+
341
+ </div>
342
+
343
+ <div class="method">
344
+ <div class="title" id="M000141">
345
+
346
+ <a name="M000141"></a><b>load_9p</b>(stream, field_values)
347
+
348
+ </div>
349
+
350
+ <div class="description">
351
+ <p>
352
+ Populates this object with information taken from the given 9P2000 byte
353
+ stream.
354
+ </p>
355
+
356
+ </div>
357
+
358
+
359
+
360
+
361
+ <div class="sourcecode">
362
+ <p class="source-link">
363
+ Source: <a href="javascript:toggleSource('M000141_source')" id="l_M000141_source">show</a>
364
+
365
+ | <a href="http://github.com/sunaku/rumai/blob/5fcf09b89976a53dd9346e335a1803b337e0c447/lib/rumai/ixp/message.rb#L213" target="_blank" class="github_url">on GitHub</a>
366
+
367
+ </p>
368
+ <div id="M000141_source" class="dyn-source">
369
+ <pre><span class="ruby-comment cmt"># File lib/rumai/ixp/message.rb, line 213</span>
370
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">load_9p</span> <span class="ruby-identifier">stream</span>, <span class="ruby-identifier">field_values</span>
371
+ <span class="ruby-identifier">field_values</span>[<span class="ruby-ivar">@name</span>] = <span class="ruby-identifier">value_from_9p</span> <span class="ruby-identifier">stream</span>
372
+ <span class="ruby-keyword kw">end</span></pre>
373
+ </div>
374
+ </div>
375
+
376
+ </div>
377
+
378
+ <div class="method">
379
+ <div class="title" id="M000140">
380
+
381
+ <a name="M000140"></a><b>to_9p</b>(field_values)
382
+
383
+ </div>
384
+
385
+ <div class="description">
386
+ <p>
387
+ Transforms this object into a string of 9P2000 bytes.
388
+ </p>
389
+
390
+ </div>
391
+
392
+
393
+
394
+
395
+ <div class="sourcecode">
396
+ <p class="source-link">
397
+ Source: <a href="javascript:toggleSource('M000140_source')" id="l_M000140_source">show</a>
398
+
399
+ | <a href="http://github.com/sunaku/rumai/blob/5fcf09b89976a53dd9346e335a1803b337e0c447/lib/rumai/ixp/message.rb#L205" target="_blank" class="github_url">on GitHub</a>
400
+
401
+ </p>
402
+ <div id="M000140_source" class="dyn-source">
403
+ <pre><span class="ruby-comment cmt"># File lib/rumai/ixp/message.rb, line 205</span>
404
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_9p</span> <span class="ruby-identifier">field_values</span>
405
+ <span class="ruby-identifier">value_to_9p</span> <span class="ruby-identifier">field_values</span>[<span class="ruby-ivar">@name</span>]
406
+ <span class="ruby-keyword kw">end</span></pre>
407
+ </div>
408
+ </div>
409
+
410
+ </div>
411
+
412
+ </div>
413
+ </div>
414
+ </body>
415
+ </html>