siffer 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +2 -2
- data/doc/rdoc/classes/Siffer.html +253 -368
- data/doc/rdoc/classes/Siffer/Agent.html +169 -288
- data/doc/rdoc/classes/Siffer/Container.html +158 -279
- data/doc/rdoc/classes/Siffer/Messages.html +79 -139
- data/doc/rdoc/classes/Siffer/Messages/Ack.html +109 -210
- data/doc/rdoc/classes/Siffer/Messages/Acl.html +78 -155
- data/doc/rdoc/classes/Siffer/Messages/Error.html +151 -242
- data/doc/rdoc/classes/Siffer/Messages/Message.html +227 -351
- data/doc/rdoc/classes/Siffer/Messages/Message/Header.html +102 -176
- data/doc/rdoc/classes/Siffer/Messages/Register.html +147 -250
- data/doc/rdoc/classes/Siffer/Messages/RequestBody.html +177 -292
- data/doc/rdoc/classes/Siffer/Messages/Status.html +149 -262
- data/doc/rdoc/classes/Siffer/Messaging.html +204 -323
- data/doc/rdoc/classes/Siffer/Protocol.html +246 -380
- data/doc/rdoc/classes/Siffer/Protocol/NonPostRequest.html +53 -110
- data/doc/rdoc/classes/Siffer/Protocol/UnknownPath.html +53 -110
- data/doc/rdoc/classes/Siffer/Registration.html +243 -383
- data/doc/rdoc/classes/Siffer/Request.html +97 -203
- data/doc/rdoc/classes/Siffer/RequestLogger.html +102 -204
- data/doc/rdoc/classes/Siffer/Response.html +85 -176
- data/doc/rdoc/classes/Siffer/Server.html +150 -236
- data/doc/rdoc/created.rid +1 -1
- data/doc/rdoc/files/LICENSE.html +75 -128
- data/doc/rdoc/files/README_rdoc.html +130 -183
- data/doc/rdoc/files/lib/siffer/agent_rb.html +49 -0
- data/doc/rdoc/files/lib/siffer/container_rb.html +57 -0
- data/doc/rdoc/files/lib/siffer/messages/ack_rb.html +49 -0
- data/doc/rdoc/files/lib/siffer/messages/acl_rb.html +49 -0
- data/doc/rdoc/files/lib/siffer/messages/error_rb.html +49 -0
- data/doc/rdoc/files/lib/siffer/messages/message_rb.html +49 -0
- data/doc/rdoc/files/lib/siffer/messages/register_rb.html +49 -0
- data/doc/rdoc/files/lib/siffer/messages/request_body_rb.html +49 -0
- data/doc/rdoc/files/lib/siffer/messages/status_rb.html +49 -0
- data/doc/rdoc/files/lib/siffer/messages_rb.html +63 -0
- data/doc/rdoc/files/lib/siffer/messaging_rb.html +49 -0
- data/doc/rdoc/files/lib/siffer/protocol_rb.html +49 -0
- data/doc/rdoc/files/lib/siffer/registration_rb.html +49 -0
- data/doc/rdoc/files/lib/siffer/request_logger_rb.html +49 -0
- data/doc/rdoc/files/lib/siffer/request_rb.html +49 -0
- data/doc/rdoc/files/lib/siffer/response_rb.html +49 -0
- data/doc/rdoc/files/lib/siffer/server_rb.html +49 -0
- data/doc/rdoc/files/lib/siffer_rb.html +62 -113
- data/doc/rdoc/fr_class_index.html +25 -47
- data/doc/rdoc/fr_file_index.html +39 -46
- data/doc/rdoc/fr_method_index.html +4539 -96
- data/doc/rdoc/index.html +14 -23
- data/doc/rdoc/rdoc-style.css +314 -203
- data/lib/siffer.rb +6 -6
- data/lib/{agent.rb → siffer/agent.rb} +5 -3
- data/lib/{container.rb → siffer/container.rb} +3 -5
- data/lib/siffer/messages.rb +7 -0
- data/lib/{messages → siffer/messages}/ack.rb +0 -0
- data/lib/{messages → siffer/messages}/acl.rb +0 -0
- data/lib/{messages → siffer/messages}/error.rb +0 -0
- data/lib/{messages → siffer/messages}/message.rb +0 -0
- data/lib/{messages → siffer/messages}/register.rb +0 -0
- data/lib/{messages → siffer/messages}/request_body.rb +0 -0
- data/lib/{messages → siffer/messages}/status.rb +0 -0
- data/lib/{messaging.rb → siffer/messaging.rb} +8 -5
- data/lib/{protocol.rb → siffer/protocol.rb} +37 -32
- data/lib/{registration.rb → siffer/registration.rb} +2 -2
- data/lib/siffer/request.rb +28 -0
- data/lib/{request_logger.rb → siffer/request_logger.rb} +8 -7
- data/lib/{response.rb → siffer/response.rb} +1 -1
- data/lib/{server.rb → siffer/server.rb} +5 -3
- data/spec/agent_spec.rb +6 -11
- data/spec/container_spec.rb +2 -2
- data/spec/default_agent +1 -1
- data/spec/messaging_spec.rb +3 -6
- data/spec/protocol_spec.rb +27 -26
- data/spec/registration_spec.rb +2 -2
- data/spec/request_logger_spec.rb +22 -9
- data/spec/request_spec.rb +15 -0
- data/spec/response_spec.rb +2 -2
- data/spec/server_spec.rb +0 -5
- data/spec/spec_helper.rb +9 -0
- metadata +40 -38
- data/doc/rdoc/files/lib/agent_rb.html +0 -101
- data/doc/rdoc/files/lib/container_rb.html +0 -108
- data/doc/rdoc/files/lib/messages/ack_rb.html +0 -101
- data/doc/rdoc/files/lib/messages/acl_rb.html +0 -101
- data/doc/rdoc/files/lib/messages/error_rb.html +0 -101
- data/doc/rdoc/files/lib/messages/message_rb.html +0 -101
- data/doc/rdoc/files/lib/messages/register_rb.html +0 -101
- data/doc/rdoc/files/lib/messages/request_body_rb.html +0 -101
- data/doc/rdoc/files/lib/messages/status_rb.html +0 -101
- data/doc/rdoc/files/lib/messages_rb.html +0 -114
- data/doc/rdoc/files/lib/messaging_rb.html +0 -101
- data/doc/rdoc/files/lib/protocol_rb.html +0 -101
- data/doc/rdoc/files/lib/registration_rb.html +0 -101
- data/doc/rdoc/files/lib/request_logger_rb.html +0 -101
- data/doc/rdoc/files/lib/request_rb.html +0 -101
- data/doc/rdoc/files/lib/response_rb.html +0 -101
- data/doc/rdoc/files/lib/server_rb.html +0 -101
- data/lib/messages.rb +0 -7
- data/lib/request.rb +0 -25
@@ -1,300 +1,185 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
<
|
7
|
-
<
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
// ]]>
|
42
|
-
</script>
|
43
|
-
|
44
|
-
</head>
|
45
|
-
<body>
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
<div id="classHeader">
|
50
|
-
<table class="header-table">
|
51
|
-
<tr class="top-aligned-row">
|
52
|
-
<td><strong>Class</strong></td>
|
53
|
-
<td class="class-name-in-header">Siffer::Messages::RequestBody</td>
|
54
|
-
</tr>
|
55
|
-
<tr class="top-aligned-row">
|
56
|
-
<td><strong>In:</strong></td>
|
57
|
-
<td>
|
58
|
-
<a href="../../../files/lib/messages/request_body_rb.html">
|
59
|
-
lib/messages/request_body.rb
|
60
|
-
</a>
|
61
|
-
<br />
|
62
|
-
</td>
|
63
|
-
</tr>
|
64
|
-
|
65
|
-
<tr class="top-aligned-row">
|
66
|
-
<td><strong>Parent:</strong></td>
|
67
|
-
<td>
|
68
|
-
Object
|
69
|
-
</td>
|
70
|
-
</tr>
|
71
|
-
</table>
|
72
|
-
</div>
|
73
|
-
<!-- banner header -->
|
74
|
-
|
75
|
-
<div id="bodyContent">
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
<div id="contextContent">
|
80
|
-
|
81
|
-
<div id="description">
|
82
|
-
<p>
|
83
|
-
This class is used to <a href="RequestBody.html#M000038">parse</a> the SIF
|
84
|
-
<a href="Message.html">Message</a> information out of the <a
|
85
|
-
href="../Request.html">Request</a> Body. It parses enough information to
|
86
|
-
redirect to other processes. It does not <a
|
87
|
-
href="RequestBody.html#M000038">parse</a> details of the <a
|
88
|
-
href="Message.html">Message</a> such as <a
|
89
|
-
href="../Protocol.html">Protocol</a> if a <a
|
90
|
-
href="Register.html">Register</a> message, or <a
|
91
|
-
href="Error.html">Error</a> if an <a href="Ack.html">Ack</a> message. Each
|
92
|
-
message <a href="RequestBody.html#M000035">type</a> will inherit this class
|
93
|
-
in order to provide a <a href="RequestBody.html#M000038">parse</a> method
|
94
|
-
that will allow access to those specific attributes. It provides access to:
|
95
|
-
</p>
|
96
|
-
<ul>
|
97
|
-
<li><a href="RequestBody.html#M000036">source_id</a>
|
98
|
-
|
99
|
-
</li>
|
100
|
-
<li><a href="RequestBody.html#M000037">msg_id</a>
|
101
|
-
|
102
|
-
</li>
|
103
|
-
<li><a href="RequestBody.html#M000035">type</a>
|
104
|
-
|
105
|
-
</li>
|
106
|
-
</ul>
|
107
|
-
|
108
|
-
</div>
|
109
|
-
|
110
|
-
|
111
|
-
</div>
|
112
|
-
|
113
|
-
<div id="method-list">
|
114
|
-
<h3 class="section-bar">Methods</h3>
|
115
|
-
|
116
|
-
<div class="name-list">
|
117
|
-
<a href="#M000037">msg_id</a>
|
118
|
-
<a href="#M000034">new</a>
|
119
|
-
<a href="#M000038">parse</a>
|
120
|
-
<a href="#M000036">source_id</a>
|
121
|
-
<a href="#M000035">type</a>
|
122
|
-
</div>
|
123
|
-
</div>
|
124
|
-
|
125
|
-
</div>
|
126
|
-
|
127
|
-
|
128
|
-
<!-- if includes -->
|
129
|
-
|
130
|
-
<div id="section">
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
<!-- if method_list -->
|
140
|
-
<div id="methods">
|
141
|
-
<h3 class="section-bar">Public Class methods</h3>
|
142
|
-
|
143
|
-
<div id="method-M000034" class="method-detail">
|
144
|
-
<a name="M000034"></a>
|
145
|
-
|
146
|
-
<div class="method-heading">
|
147
|
-
<a href="#M000034" class="method-signature">
|
148
|
-
<span class="method-name">new</span><span class="method-args">(xml_string)</span>
|
149
|
-
</a>
|
150
|
-
</div>
|
151
|
-
|
152
|
-
<div class="method-description">
|
153
|
-
<p><a class="source-toggle" href="#"
|
154
|
-
onclick="toggleCode('M000034-source');return false;">[Source]</a></p>
|
155
|
-
<div class="method-source-code" id="M000034-source">
|
156
|
-
<pre>
|
157
|
-
<span class="ruby-comment cmt"># File lib/messages/request_body.rb, line 17</span>
|
158
|
-
17: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">xml_string</span>)
|
159
|
-
18: <span class="ruby-ivar">@xml</span> = <span class="ruby-identifier">xml_string</span>
|
160
|
-
19: <span class="ruby-ivar">@doc</span> = <span class="ruby-constant">Hpricot</span>(<span class="ruby-ivar">@xml</span>, <span class="ruby-identifier">:xml</span> =<span class="ruby-operator">></span> <span class="ruby-keyword kw">true</span>)
|
161
|
-
20: <span class="ruby-keyword kw">end</span>
|
162
|
-
</pre>
|
163
|
-
</div>
|
164
|
-
</div>
|
165
|
-
</div>
|
166
|
-
|
167
|
-
<div id="method-M000038" class="method-detail">
|
168
|
-
<a name="M000038"></a>
|
169
|
-
|
170
|
-
<div class="method-heading">
|
171
|
-
<a href="#M000038" class="method-signature">
|
172
|
-
<span class="method-name">parse</span><span class="method-args">(xml)</span>
|
173
|
-
</a>
|
174
|
-
</div>
|
175
|
-
|
176
|
-
<div class="method-description">
|
177
|
-
<p>
|
178
|
-
Parses the xml provided and returns a <a
|
179
|
-
href="RequestBody.html">RequestBody</a>. Xml must respond to read or be a
|
180
|
-
String.
|
181
|
-
</p>
|
182
|
-
<p><a class="source-toggle" href="#"
|
183
|
-
onclick="toggleCode('M000038-source');return false;">[Source]</a></p>
|
184
|
-
<div class="method-source-code" id="M000038-source">
|
185
|
-
<pre>
|
186
|
-
<span class="ruby-comment cmt"># File lib/messages/request_body.rb, line 48</span>
|
187
|
-
48: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">parse</span>(<span class="ruby-identifier">xml</span>)
|
188
|
-
49: <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">xml</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-value str">"read"</span>) <span class="ruby-keyword kw">or</span> <span class="ruby-identifier">xml</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">String</span>)
|
189
|
-
50: <span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-value str">"Unable to read Xml"</span>
|
190
|
-
51: <span class="ruby-keyword kw">end</span>
|
191
|
-
52: <span class="ruby-identifier">xml</span> = <span class="ruby-identifier">xml</span>.<span class="ruby-identifier">read</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">xml</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-value str">"read"</span>)
|
192
|
-
53: <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">xml</span>) <span class="ruby-comment cmt"># use self because we are going to inherit this class</span>
|
193
|
-
54: <span class="ruby-keyword kw">end</span>
|
194
|
-
</pre>
|
195
|
-
</div>
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
2
|
+
<html lang='en'>
|
3
|
+
<head>
|
4
|
+
<title>Class: Siffer::Messages::RequestBody [Siffer == h3o(software) SIF]</title>
|
5
|
+
<meta content='text/html; charset=UTF-8' http-equiv='Content-Type'>
|
6
|
+
<link href='../../.././rdoc-style.css' media='screen' rel='stylesheet' type='text/css'>
|
7
|
+
<script type='text/javascript'>
|
8
|
+
//<![CDATA[
|
9
|
+
function popupCode(url) {
|
10
|
+
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
11
|
+
}
|
12
|
+
|
13
|
+
function toggleCode(id) {
|
14
|
+
var code = document.getElementById(id)
|
15
|
+
|
16
|
+
code.style.display = code.style.display != 'block' ? 'block' : 'none'
|
17
|
+
return true
|
18
|
+
}
|
19
|
+
|
20
|
+
// Make codeblocks hidden by default
|
21
|
+
document.writeln('<' + 'style type="text/css">.method .source pre { display: none }<\/style>')
|
22
|
+
//]]>
|
23
|
+
</script>
|
24
|
+
</head>
|
25
|
+
<body class='page'>
|
26
|
+
<div class='class' id='wrapper'>
|
27
|
+
<div class='header'>
|
28
|
+
<h1 class='name'>
|
29
|
+
<span class='type'>Class</span>
|
30
|
+
Siffer::Messages::RequestBody
|
31
|
+
</h1>
|
32
|
+
<ol class='paths'>
|
33
|
+
<li>
|
34
|
+
<a href="../../../files/lib/siffer/messages/request_body_rb.html">lib/siffer/messages/request_body.rb</a>
|
35
|
+
</li>
|
36
|
+
</ol>
|
37
|
+
<div class='parent'>
|
38
|
+
Parent:
|
39
|
+
<strong>Object</strong>
|
196
40
|
</div>
|
197
41
|
</div>
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
<
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
</
|
42
|
+
<div id='content'>
|
43
|
+
<div id='text'>
|
44
|
+
<div id='description'>
|
45
|
+
<p>
|
46
|
+
This class is used to parse the SIF <a href="Message.html">Message</a>
|
47
|
+
information out of the <a href="../Request.html">Request</a> Body. It
|
48
|
+
parses enough information to redirect to other processes. It does not parse
|
49
|
+
details of the <a href="Message.html">Message</a> such as <a
|
50
|
+
href="../Protocol.html">Protocol</a> if a <a
|
51
|
+
href="Register.html">Register</a> message, or <a
|
52
|
+
href="Error.html">Error</a> if an <a href="Ack.html">Ack</a> message. Each
|
53
|
+
message type will inherit this class in order to provide a <a
|
54
|
+
href="RequestBody.html#M000039">parse</a> method that will allow access to
|
55
|
+
those specific attributes. It provides access to:
|
56
|
+
</p>
|
57
|
+
<ul>
|
58
|
+
<li><a href="RequestBody.html#M000037">source_id</a>
|
59
|
+
|
60
|
+
</li>
|
61
|
+
<li><a href="RequestBody.html#M000038">msg_id</a>
|
62
|
+
|
63
|
+
</li>
|
64
|
+
<li>type
|
65
|
+
|
66
|
+
</li>
|
67
|
+
</ul>
|
223
68
|
</div>
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
<p>
|
238
|
-
The SIF_SourceId from the SIF_Header
|
239
|
-
</p>
|
240
|
-
<p><a class="source-toggle" href="#"
|
241
|
-
onclick="toggleCode('M000036-source');return false;">[Source]</a></p>
|
242
|
-
<div class="method-source-code" id="M000036-source">
|
243
|
-
<pre>
|
244
|
-
<span class="ruby-comment cmt"># File lib/messages/request_body.rb, line 37</span>
|
245
|
-
37: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">source_id</span>
|
246
|
-
38: (<span class="ruby-ivar">@doc</span><span class="ruby-operator">/</span><span class="ruby-value str">"//SIF_Header/SIF_SourceId/"</span>).<span class="ruby-identifier">text</span>
|
247
|
-
39: <span class="ruby-keyword kw">end</span>
|
248
|
-
</pre>
|
69
|
+
<div id='method-list'>
|
70
|
+
<h2>Methods</h2>
|
71
|
+
<h3>public class</h3>
|
72
|
+
<ol>
|
73
|
+
<li><a href="#M000035">new</a></li>
|
74
|
+
<li><a href="#M000039">parse</a></li>
|
75
|
+
</ol>
|
76
|
+
<h3>public instance</h3>
|
77
|
+
<ol>
|
78
|
+
<li><a href="#M000038">msg_id</a></li>
|
79
|
+
<li><a href="#M000037">source_id</a></li>
|
80
|
+
<li><a href="#M000036">type</a></li>
|
81
|
+
</ol>
|
249
82
|
</div>
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
<
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
</pre>
|
83
|
+
<div id='section'>
|
84
|
+
<div id='methods'>
|
85
|
+
<h2>Public class methods</h2>
|
86
|
+
<div class='public-class method' id='method-M000035'>
|
87
|
+
<a name='M000035'> </a>
|
88
|
+
<div class='synopsis'>
|
89
|
+
<span class='name'>new</span>
|
90
|
+
<span class='arguments'>(xml_string)</span>
|
91
|
+
</div>
|
92
|
+
<div class='source'>
|
93
|
+
<a class='source-toggle' href='#' onclick="toggleCode('M000035-source'); return false">
|
94
|
+
[show source]
|
95
|
+
</a>
|
96
|
+
<pre id='M000035-source'> <span class="ruby-comment cmt"># File lib/siffer/messages/request_body.rb, line 17</span>
17: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">xml_string</span>)
18: <span class="ruby-ivar">@xml</span> = <span class="ruby-identifier">xml_string</span>
19: <span class="ruby-ivar">@doc</span> = <span class="ruby-constant">Hpricot</span>(<span class="ruby-ivar">@xml</span>, <span class="ruby-identifier">:xml</span> =<span class="ruby-operator">></span> <span class="ruby-keyword kw">true</span>)
20: <span class="ruby-keyword kw">end</span></pre>
|
97
|
+
</div>
|
98
|
+
</div>
|
99
|
+
<div class='public-class method' id='method-M000039'>
|
100
|
+
<a name='M000039'> </a>
|
101
|
+
<div class='synopsis'>
|
102
|
+
<span class='name'>parse</span>
|
103
|
+
<span class='arguments'>(xml)</span>
|
104
|
+
</div>
|
105
|
+
<div class='description'>
|
106
|
+
<p>
|
107
|
+
Parses the xml provided and returns a <a
|
108
|
+
href="RequestBody.html">RequestBody</a>. Xml must respond to read or be a
|
109
|
+
String.
|
110
|
+
</p>
|
111
|
+
</div>
|
112
|
+
<div class='source'>
|
113
|
+
<a class='source-toggle' href='#' onclick="toggleCode('M000039-source'); return false">
|
114
|
+
[show source]
|
115
|
+
</a>
|
116
|
+
<pre id='M000039-source'> <span class="ruby-comment cmt"># File lib/siffer/messages/request_body.rb, line 48</span>
48: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">parse</span>(<span class="ruby-identifier">xml</span>)
49: <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">xml</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-value str">"read"</span>) <span class="ruby-keyword kw">or</span> <span class="ruby-identifier">xml</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">String</span>)
50: <span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-value str">"Unable to read Xml"</span> 
51: <span class="ruby-keyword kw">end</span>
52: <span class="ruby-identifier">xml</span> = <span class="ruby-identifier">xml</span>.<span class="ruby-identifier">read</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">xml</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-value str">"read"</span>)
53: <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">xml</span>) <span class="ruby-comment cmt"># use self because we are going to inherit this class</span>
54: <span class="ruby-keyword kw">end</span></pre>
|
117
|
+
</div>
|
118
|
+
</div>
|
119
|
+
<h2>Public instance methods</h2>
|
120
|
+
<div class='public-instance method' id='method-M000038'>
|
121
|
+
<a name='M000038'> </a>
|
122
|
+
<div class='synopsis'>
|
123
|
+
<span class='name'>msg_id</span>
|
124
|
+
<span class='arguments'>()</span>
|
125
|
+
</div>
|
126
|
+
<div class='description'>
|
127
|
+
<p>
|
128
|
+
The SIF_MsgId from the SIF_Header
|
129
|
+
</p>
|
130
|
+
</div>
|
131
|
+
<div class='source'>
|
132
|
+
<a class='source-toggle' href='#' onclick="toggleCode('M000038-source'); return false">
|
133
|
+
[show source]
|
134
|
+
</a>
|
135
|
+
<pre id='M000038-source'> <span class="ruby-comment cmt"># File lib/siffer/messages/request_body.rb, line 42</span>
42: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">msg_id</span>
43: (<span class="ruby-ivar">@doc</span><span class="ruby-operator">/</span><span class="ruby-value str">"//SIF_Header/SIF_MsgId/"</span>).<span class="ruby-identifier">text</span>
44: <span class="ruby-keyword kw">end</span></pre>
|
136
|
+
</div>
|
137
|
+
</div>
|
138
|
+
<div class='public-instance method' id='method-M000037'>
|
139
|
+
<a name='M000037'> </a>
|
140
|
+
<div class='synopsis'>
|
141
|
+
<span class='name'>source_id</span>
|
142
|
+
<span class='arguments'>()</span>
|
143
|
+
</div>
|
144
|
+
<div class='description'>
|
145
|
+
<p>
|
146
|
+
The SIF_SourceId from the SIF_Header
|
147
|
+
</p>
|
148
|
+
</div>
|
149
|
+
<div class='source'>
|
150
|
+
<a class='source-toggle' href='#' onclick="toggleCode('M000037-source'); return false">
|
151
|
+
[show source]
|
152
|
+
</a>
|
153
|
+
<pre id='M000037-source'> <span class="ruby-comment cmt"># File lib/siffer/messages/request_body.rb, line 37</span>
37: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">source_id</span>
38: (<span class="ruby-ivar">@doc</span><span class="ruby-operator">/</span><span class="ruby-value str">"//SIF_Header/SIF_SourceId/"</span>).<span class="ruby-identifier">text</span>
39: <span class="ruby-keyword kw">end</span></pre>
|
154
|
+
</div>
|
155
|
+
</div>
|
156
|
+
<div class='public-instance method' id='method-M000036'>
|
157
|
+
<a name='M000036'> </a>
|
158
|
+
<div class='synopsis'>
|
159
|
+
<span class='name'>type</span>
|
160
|
+
<span class='arguments'>()</span>
|
161
|
+
</div>
|
162
|
+
<div class='description'>
|
163
|
+
<p>
|
164
|
+
Will return the name of the element found just inside the root or just
|
165
|
+
inside SIF_SystemControl if present.
|
166
|
+
</p>
|
167
|
+
</div>
|
168
|
+
<div class='source'>
|
169
|
+
<a class='source-toggle' href='#' onclick="toggleCode('M000036-source'); return false">
|
170
|
+
[show source]
|
171
|
+
</a>
|
172
|
+
<pre id='M000036-source'> <span class="ruby-comment cmt"># File lib/siffer/messages/request_body.rb, line 24</span>
24: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">type</span>
25: <span class="ruby-keyword kw">begin</span>
26: <span class="ruby-identifier">msg_type</span> = (<span class="ruby-ivar">@doc</span><span class="ruby-operator">/</span><span class="ruby-identifier">:SIF_Message</span>).<span class="ruby-identifier">first</span>.<span class="ruby-identifier">children</span>[<span class="ruby-value">0</span>].<span class="ruby-identifier">name</span>
27: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">msg_type</span> <span class="ruby-operator">==</span> <span class="ruby-value str">"SIF_SystemControl"</span>
28: <span class="ruby-identifier">msg_type</span> = (<span class="ruby-ivar">@doc</span><span class="ruby-operator">/</span><span class="ruby-identifier">:SIF_Message</span><span class="ruby-operator">/</span><span class="ruby-identifier">:SIF_SystemControl</span>).<span class="ruby-identifier">first</span>.<span class="ruby-identifier">children</span>[<span class="ruby-value">0</span>].<span class="ruby-identifier">name</span>
29: <span class="ruby-keyword kw">end</span>
30: <span class="ruby-identifier">drop_sif</span> <span class="ruby-identifier">msg_type</span>
31: <span class="ruby-keyword kw">rescue</span>
32: <span class="ruby-identifier">raise</span> <span class="ruby-node">"Failed to parse #{@xml} for SIF Type"</span>
33: <span class="ruby-keyword kw">end</span>
34: <span class="ruby-keyword kw">end</span></pre>
|
173
|
+
</div>
|
174
|
+
</div>
|
175
|
+
</div>
|
284
176
|
</div>
|
285
177
|
</div>
|
286
178
|
</div>
|
287
|
-
|
288
|
-
|
179
|
+
<div id='footer-push'></div>
|
180
|
+
</div>
|
181
|
+
<div id='footer'>
|
182
|
+
<a href="http://github.com/mislav/hanna/tree/master"><strong>Hanna</strong> RDoc template</a>
|
289
183
|
</div>
|
290
|
-
|
291
|
-
|
292
|
-
</div>
|
293
|
-
|
294
|
-
|
295
|
-
<div id="validator-badges">
|
296
|
-
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
297
|
-
</div>
|
298
|
-
|
299
|
-
</body>
|
300
|
-
</html>
|
184
|
+
</body>
|
185
|
+
</html>
|