siffer 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (97) hide show
  1. data/Rakefile +2 -2
  2. data/doc/rdoc/classes/Siffer.html +253 -368
  3. data/doc/rdoc/classes/Siffer/Agent.html +169 -288
  4. data/doc/rdoc/classes/Siffer/Container.html +158 -279
  5. data/doc/rdoc/classes/Siffer/Messages.html +79 -139
  6. data/doc/rdoc/classes/Siffer/Messages/Ack.html +109 -210
  7. data/doc/rdoc/classes/Siffer/Messages/Acl.html +78 -155
  8. data/doc/rdoc/classes/Siffer/Messages/Error.html +151 -242
  9. data/doc/rdoc/classes/Siffer/Messages/Message.html +227 -351
  10. data/doc/rdoc/classes/Siffer/Messages/Message/Header.html +102 -176
  11. data/doc/rdoc/classes/Siffer/Messages/Register.html +147 -250
  12. data/doc/rdoc/classes/Siffer/Messages/RequestBody.html +177 -292
  13. data/doc/rdoc/classes/Siffer/Messages/Status.html +149 -262
  14. data/doc/rdoc/classes/Siffer/Messaging.html +204 -323
  15. data/doc/rdoc/classes/Siffer/Protocol.html +246 -380
  16. data/doc/rdoc/classes/Siffer/Protocol/NonPostRequest.html +53 -110
  17. data/doc/rdoc/classes/Siffer/Protocol/UnknownPath.html +53 -110
  18. data/doc/rdoc/classes/Siffer/Registration.html +243 -383
  19. data/doc/rdoc/classes/Siffer/Request.html +97 -203
  20. data/doc/rdoc/classes/Siffer/RequestLogger.html +102 -204
  21. data/doc/rdoc/classes/Siffer/Response.html +85 -176
  22. data/doc/rdoc/classes/Siffer/Server.html +150 -236
  23. data/doc/rdoc/created.rid +1 -1
  24. data/doc/rdoc/files/LICENSE.html +75 -128
  25. data/doc/rdoc/files/README_rdoc.html +130 -183
  26. data/doc/rdoc/files/lib/siffer/agent_rb.html +49 -0
  27. data/doc/rdoc/files/lib/siffer/container_rb.html +57 -0
  28. data/doc/rdoc/files/lib/siffer/messages/ack_rb.html +49 -0
  29. data/doc/rdoc/files/lib/siffer/messages/acl_rb.html +49 -0
  30. data/doc/rdoc/files/lib/siffer/messages/error_rb.html +49 -0
  31. data/doc/rdoc/files/lib/siffer/messages/message_rb.html +49 -0
  32. data/doc/rdoc/files/lib/siffer/messages/register_rb.html +49 -0
  33. data/doc/rdoc/files/lib/siffer/messages/request_body_rb.html +49 -0
  34. data/doc/rdoc/files/lib/siffer/messages/status_rb.html +49 -0
  35. data/doc/rdoc/files/lib/siffer/messages_rb.html +63 -0
  36. data/doc/rdoc/files/lib/siffer/messaging_rb.html +49 -0
  37. data/doc/rdoc/files/lib/siffer/protocol_rb.html +49 -0
  38. data/doc/rdoc/files/lib/siffer/registration_rb.html +49 -0
  39. data/doc/rdoc/files/lib/siffer/request_logger_rb.html +49 -0
  40. data/doc/rdoc/files/lib/siffer/request_rb.html +49 -0
  41. data/doc/rdoc/files/lib/siffer/response_rb.html +49 -0
  42. data/doc/rdoc/files/lib/siffer/server_rb.html +49 -0
  43. data/doc/rdoc/files/lib/siffer_rb.html +62 -113
  44. data/doc/rdoc/fr_class_index.html +25 -47
  45. data/doc/rdoc/fr_file_index.html +39 -46
  46. data/doc/rdoc/fr_method_index.html +4539 -96
  47. data/doc/rdoc/index.html +14 -23
  48. data/doc/rdoc/rdoc-style.css +314 -203
  49. data/lib/siffer.rb +6 -6
  50. data/lib/{agent.rb → siffer/agent.rb} +5 -3
  51. data/lib/{container.rb → siffer/container.rb} +3 -5
  52. data/lib/siffer/messages.rb +7 -0
  53. data/lib/{messages → siffer/messages}/ack.rb +0 -0
  54. data/lib/{messages → siffer/messages}/acl.rb +0 -0
  55. data/lib/{messages → siffer/messages}/error.rb +0 -0
  56. data/lib/{messages → siffer/messages}/message.rb +0 -0
  57. data/lib/{messages → siffer/messages}/register.rb +0 -0
  58. data/lib/{messages → siffer/messages}/request_body.rb +0 -0
  59. data/lib/{messages → siffer/messages}/status.rb +0 -0
  60. data/lib/{messaging.rb → siffer/messaging.rb} +8 -5
  61. data/lib/{protocol.rb → siffer/protocol.rb} +37 -32
  62. data/lib/{registration.rb → siffer/registration.rb} +2 -2
  63. data/lib/siffer/request.rb +28 -0
  64. data/lib/{request_logger.rb → siffer/request_logger.rb} +8 -7
  65. data/lib/{response.rb → siffer/response.rb} +1 -1
  66. data/lib/{server.rb → siffer/server.rb} +5 -3
  67. data/spec/agent_spec.rb +6 -11
  68. data/spec/container_spec.rb +2 -2
  69. data/spec/default_agent +1 -1
  70. data/spec/messaging_spec.rb +3 -6
  71. data/spec/protocol_spec.rb +27 -26
  72. data/spec/registration_spec.rb +2 -2
  73. data/spec/request_logger_spec.rb +22 -9
  74. data/spec/request_spec.rb +15 -0
  75. data/spec/response_spec.rb +2 -2
  76. data/spec/server_spec.rb +0 -5
  77. data/spec/spec_helper.rb +9 -0
  78. metadata +40 -38
  79. data/doc/rdoc/files/lib/agent_rb.html +0 -101
  80. data/doc/rdoc/files/lib/container_rb.html +0 -108
  81. data/doc/rdoc/files/lib/messages/ack_rb.html +0 -101
  82. data/doc/rdoc/files/lib/messages/acl_rb.html +0 -101
  83. data/doc/rdoc/files/lib/messages/error_rb.html +0 -101
  84. data/doc/rdoc/files/lib/messages/message_rb.html +0 -101
  85. data/doc/rdoc/files/lib/messages/register_rb.html +0 -101
  86. data/doc/rdoc/files/lib/messages/request_body_rb.html +0 -101
  87. data/doc/rdoc/files/lib/messages/status_rb.html +0 -101
  88. data/doc/rdoc/files/lib/messages_rb.html +0 -114
  89. data/doc/rdoc/files/lib/messaging_rb.html +0 -101
  90. data/doc/rdoc/files/lib/protocol_rb.html +0 -101
  91. data/doc/rdoc/files/lib/registration_rb.html +0 -101
  92. data/doc/rdoc/files/lib/request_logger_rb.html +0 -101
  93. data/doc/rdoc/files/lib/request_rb.html +0 -101
  94. data/doc/rdoc/files/lib/response_rb.html +0 -101
  95. data/doc/rdoc/files/lib/server_rb.html +0 -101
  96. data/lib/messages.rb +0 -7
  97. data/lib/request.rb +0 -25
@@ -1,300 +1,185 @@
1
- <?xml version="1.0" encoding="iso-8859-1"?>
2
- <!DOCTYPE html
3
- PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
-
6
- <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
7
- <head>
8
- <title>Class: Siffer::Messages::RequestBody</title>
9
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
- <meta http-equiv="Content-Script-Type" content="text/javascript" />
11
- <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
12
- <script type="text/javascript">
13
- // <![CDATA[
14
-
15
- function popupCode( url ) {
16
- window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
17
- }
18
-
19
- function toggleCode( id ) {
20
- if ( document.getElementById )
21
- elem = document.getElementById( id );
22
- else if ( document.all )
23
- elem = eval( "document.all." + id );
24
- else
25
- return false;
26
-
27
- elemStyle = elem.style;
28
-
29
- if ( elemStyle.display != "block" ) {
30
- elemStyle.display = "block"
31
- } else {
32
- elemStyle.display = "none"
33
- }
34
-
35
- return true;
36
- }
37
-
38
- // Make codeblocks hidden by default
39
- document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
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>&nbsp;&nbsp;
118
- <a href="#M000034">new</a>&nbsp;&nbsp;
119
- <a href="#M000038">parse</a>&nbsp;&nbsp;
120
- <a href="#M000036">source_id</a>&nbsp;&nbsp;
121
- <a href="#M000035">type</a>&nbsp;&nbsp;
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">&gt;</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">&quot;read&quot;</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">&quot;Unable to read Xml&quot;</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">&quot;read&quot;</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
- <h3 class="section-bar">Public Instance methods</h3>
200
-
201
- <div id="method-M000037" class="method-detail">
202
- <a name="M000037"></a>
203
-
204
- <div class="method-heading">
205
- <a href="#M000037" class="method-signature">
206
- <span class="method-name">msg_id</span><span class="method-args">()</span>
207
- </a>
208
- </div>
209
-
210
- <div class="method-description">
211
- <p>
212
- The SIF_MsgId from the SIF_Header
213
- </p>
214
- <p><a class="source-toggle" href="#"
215
- onclick="toggleCode('M000037-source');return false;">[Source]</a></p>
216
- <div class="method-source-code" id="M000037-source">
217
- <pre>
218
- <span class="ruby-comment cmt"># File lib/messages/request_body.rb, line 42</span>
219
- 42: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">msg_id</span>
220
- 43: (<span class="ruby-ivar">@doc</span><span class="ruby-operator">/</span><span class="ruby-value str">&quot;//SIF_Header/SIF_MsgId/&quot;</span>).<span class="ruby-identifier">text</span>
221
- 44: <span class="ruby-keyword kw">end</span>
222
- </pre>
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
- </div>
225
- </div>
226
-
227
- <div id="method-M000036" class="method-detail">
228
- <a name="M000036"></a>
229
-
230
- <div class="method-heading">
231
- <a href="#M000036" class="method-signature">
232
- <span class="method-name">source_id</span><span class="method-args">()</span>
233
- </a>
234
- </div>
235
-
236
- <div class="method-description">
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">&quot;//SIF_Header/SIF_SourceId/&quot;</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
- </div>
251
- </div>
252
-
253
- <div id="method-M000035" class="method-detail">
254
- <a name="M000035"></a>
255
-
256
- <div class="method-heading">
257
- <a href="#M000035" class="method-signature">
258
- <span class="method-name">type</span><span class="method-args">()</span>
259
- </a>
260
- </div>
261
-
262
- <div class="method-description">
263
- <p>
264
- Will return the name of the element found just inside the root or just
265
- inside SIF_SystemControl if present.
266
- </p>
267
- <p><a class="source-toggle" href="#"
268
- onclick="toggleCode('M000035-source');return false;">[Source]</a></p>
269
- <div class="method-source-code" id="M000035-source">
270
- <pre>
271
- <span class="ruby-comment cmt"># File lib/messages/request_body.rb, line 24</span>
272
- 24: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">type</span>
273
- 25: <span class="ruby-keyword kw">begin</span>
274
- 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>
275
- 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">&quot;SIF_SystemControl&quot;</span>
276
- 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>
277
- 29: <span class="ruby-keyword kw">end</span>
278
- 30: <span class="ruby-identifier">drop_sif</span> <span class="ruby-identifier">msg_type</span>
279
- 31: <span class="ruby-keyword kw">rescue</span>
280
- 32: <span class="ruby-identifier">raise</span> <span class="ruby-node">&quot;Failed to parse #{@xml} for SIF Type&quot;</span>
281
- 33: <span class="ruby-keyword kw">end</span>
282
- 34: <span class="ruby-keyword kw">end</span>
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>&#x000A;17: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">xml_string</span>)&#x000A;18: <span class="ruby-ivar">@xml</span> = <span class="ruby-identifier">xml_string</span>&#x000A;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">&gt;</span> <span class="ruby-keyword kw">true</span>)&#x000A;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>&#x000A;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>)&#x000A;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">&quot;read&quot;</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>)&#x000A;50: <span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-value str">&quot;Unable to read Xml&quot;</span> &#x000A;51: <span class="ruby-keyword kw">end</span>&#x000A;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">&quot;read&quot;</span>)&#x000A;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>&#x000A;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>&#x000A;42: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">msg_id</span>&#x000A;43: (<span class="ruby-ivar">@doc</span><span class="ruby-operator">/</span><span class="ruby-value str">&quot;//SIF_Header/SIF_MsgId/&quot;</span>).<span class="ruby-identifier">text</span>&#x000A;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>&#x000A;37: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">source_id</span>&#x000A;38: (<span class="ruby-ivar">@doc</span><span class="ruby-operator">/</span><span class="ruby-value str">&quot;//SIF_Header/SIF_SourceId/&quot;</span>).<span class="ruby-identifier">text</span>&#x000A;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>&#x000A;24: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">type</span>&#x000A;25: <span class="ruby-keyword kw">begin</span>&#x000A;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>&#x000A;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">&quot;SIF_SystemControl&quot;</span>&#x000A;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>&#x000A;29: <span class="ruby-keyword kw">end</span>&#x000A;30: <span class="ruby-identifier">drop_sif</span> <span class="ruby-identifier">msg_type</span>&#x000A;31: <span class="ruby-keyword kw">rescue</span>&#x000A;32: <span class="ruby-identifier">raise</span> <span class="ruby-node">&quot;Failed to parse #{@xml} for SIF Type&quot;</span>&#x000A;33: <span class="ruby-keyword kw">end</span>&#x000A;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>