libastag 0.0.1

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 (96) hide show
  1. data/CHANGES +7 -0
  2. data/MIT-LICENSE +19 -0
  3. data/README +65 -0
  4. data/Rakefile +276 -0
  5. data/TODO +7 -0
  6. data/doc/classes/Helpers/REXML/Attributes.html +179 -0
  7. data/doc/classes/Helpers/REXML.html +115 -0
  8. data/doc/classes/Helpers.html +181 -0
  9. data/doc/classes/Libastag/Rabbit.html +462 -0
  10. data/doc/classes/Libastag/RabitEar.html +120 -0
  11. data/doc/classes/Libastag/RabitLed.html +120 -0
  12. data/doc/classes/Libastag.html +141 -0
  13. data/doc/classes/Request/Action.html +213 -0
  14. data/doc/classes/Request/Base/Event.html +226 -0
  15. data/doc/classes/Request/Base/EventCollection.html +246 -0
  16. data/doc/classes/Request/Base.html +134 -0
  17. data/doc/classes/Request/GET_EARS_POSITION.html +151 -0
  18. data/doc/classes/Request/Query.html +244 -0
  19. data/doc/classes/Request/SetEarsPosition.html +213 -0
  20. data/doc/classes/Request/TtsMessage.html +235 -0
  21. data/doc/classes/Request.html +414 -0
  22. data/doc/classes/Response/AbuseSending.html +165 -0
  23. data/doc/classes/Response/Base/BadServerRsp.html +163 -0
  24. data/doc/classes/Response/Base/GoodServerRsp.html +161 -0
  25. data/doc/classes/Response/Base/ServerRsp.html +347 -0
  26. data/doc/classes/Response/Base.html +162 -0
  27. data/doc/classes/Response/Blacklist.html +165 -0
  28. data/doc/classes/Response/ChorNotSend.html +166 -0
  29. data/doc/classes/Response/ChorSend.html +165 -0
  30. data/doc/classes/Response/CommandSend.html +168 -0
  31. data/doc/classes/Response/EarPositionNotSend.html +165 -0
  32. data/doc/classes/Response/EarPositionSend.html +165 -0
  33. data/doc/classes/Response/EmptyServerRsp.html +161 -0
  34. data/doc/classes/Response/LangListUser.html +166 -0
  35. data/doc/classes/Response/LinkPreview.html +165 -0
  36. data/doc/classes/Response/ListFriend.html +165 -0
  37. data/doc/classes/Response/ListReceivedMsg.html +165 -0
  38. data/doc/classes/Response/MessageNotSend.html +165 -0
  39. data/doc/classes/Response/MessageSend.html +165 -0
  40. data/doc/classes/Response/NabCastNotSend.html +169 -0
  41. data/doc/classes/Response/NabCastSend.html +165 -0
  42. data/doc/classes/Response/NoCorrectParameters.html +165 -0
  43. data/doc/classes/Response/NoGoodTokenOrSerial.html +165 -0
  44. data/doc/classes/Response/NotV2Rabbit.html +165 -0
  45. data/doc/classes/Response/PositionEar.html +166 -0
  46. data/doc/classes/Response/ProtocolExcepion.html +164 -0
  47. data/doc/classes/Response/RabbitName.html +164 -0
  48. data/doc/classes/Response/RabbitSleep.html +164 -0
  49. data/doc/classes/Response/RabbitVersion.html +164 -0
  50. data/doc/classes/Response/Signature.html +164 -0
  51. data/doc/classes/Response/Timezone.html +164 -0
  52. data/doc/classes/Response/TtsNotSend.html +168 -0
  53. data/doc/classes/Response/TtsSend.html +165 -0
  54. data/doc/classes/Response/VoiceListTts.html +165 -0
  55. data/doc/classes/Response/WebRadioNotSend.html +165 -0
  56. data/doc/classes/Response/WebRadioSend.html +165 -0
  57. data/doc/classes/Response.html +337 -0
  58. data/doc/classes/VioletAPI.html +118 -0
  59. data/doc/created.rid +1 -0
  60. data/doc/dot/f_0.dot +14 -0
  61. data/doc/dot/f_0.png +0 -0
  62. data/doc/dot/f_4.dot +57 -0
  63. data/doc/dot/f_4.png +0 -0
  64. data/doc/dot/f_5.dot +489 -0
  65. data/doc/dot/f_5.png +0 -0
  66. data/doc/dot/f_6.dot +55 -0
  67. data/doc/dot/f_6.png +0 -0
  68. data/doc/dot/f_7.dot +30 -0
  69. data/doc/dot/f_7.png +0 -0
  70. data/doc/dot/f_8.dot +142 -0
  71. data/doc/dot/f_8.png +0 -0
  72. data/doc/files/CHANGES.html +126 -0
  73. data/doc/files/MIT-LICENSE.html +134 -0
  74. data/doc/files/README.html +192 -0
  75. data/doc/files/TODO.html +126 -0
  76. data/doc/files/lib/libastag_rb.html +116 -0
  77. data/doc/files/lib/violet/helpers_rb.html +123 -0
  78. data/doc/files/lib/violet/request_rb.html +133 -0
  79. data/doc/files/lib/violet/response_rb.html +220 -0
  80. data/doc/files/lib/violet/violetapi_rb.html +114 -0
  81. data/doc/fr_class_index.html +79 -0
  82. data/doc/fr_file_index.html +35 -0
  83. data/doc/fr_method_index.html +56 -0
  84. data/doc/index.html +24 -0
  85. data/doc/rdoc-style.css +208 -0
  86. data/lib/libastag.rb +116 -0
  87. data/lib/violet/helpers.rb +48 -0
  88. data/lib/violet/request.rb +301 -0
  89. data/lib/violet/response.rb +412 -0
  90. data/lib/violet/violetapi.rb +14 -0
  91. data/test/fake_violet_srv.rb +94 -0
  92. data/test/test_helpers.rb +31 -0
  93. data/test/test_request.rb +20 -0
  94. data/test/test_response.rb +295 -0
  95. data/test/test_send.rb +137 -0
  96. metadata +264 -0
@@ -0,0 +1,151 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
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>Module: Request::GET_EARS_POSITION</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
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>Module</strong></td>
53
+ <td class="class-name-in-header">Request::GET_EARS_POSITION</td>
54
+ </tr>
55
+ <tr class="top-aligned-row">
56
+ <td><strong>In:</strong></td>
57
+ <td>
58
+ </td>
59
+ </tr>
60
+
61
+ </table>
62
+ </div>
63
+ <!-- banner header -->
64
+
65
+ <div id="bodyContent">
66
+
67
+
68
+
69
+ <div id="contextContent">
70
+ <div id="diagram">
71
+ <map id="map" name="map">
72
+ <area shape="rect" coords="392,85,464,133" href="Base/Event.html" alt="Event" />
73
+ <area shape="rect" coords="27,181,99,229" href="Action.html" alt="Action" />
74
+ <area shape="rect" coords="123,181,211,229" href="TtsMessage.html" alt="TtsMessage" />
75
+ <area shape="rect" coords="235,181,341,229" href="SetEarsPosition.html" alt="SetEarsPosition" />
76
+ <area shape="rect" coords="365,181,469,229" href="Base/EventCollection.html" alt="EventCollection" />
77
+ <area shape="rect" coords="647,85,724,133" href="../Enumerable.html" alt="Enumerable" />
78
+ <area shape="rect" coords="135,85,207,133" href="Query.html" alt="Query" />
79
+ <area shape="rect" coords="491,73,625,121" href="GET_EARS_POSITION.html" alt="GET_EARS_POSITION" />
80
+ <area shape="rect" coords="355,51,480,240" href="Base.html" alt="Base" />
81
+ <area shape="rect" coords="16,16,636,251" href="../Request.html" alt="Request" />
82
+ </map>
83
+ <img src="../../dot/f_8.png" usemap="#map" border="0" alt="dot/f_8.png">
84
+ </div>
85
+
86
+
87
+
88
+ </div>
89
+
90
+ <div id="method-list">
91
+ <h3 class="section-bar">Methods</h3>
92
+
93
+ <div class="name-list">
94
+ <a href="#M000015">to_url</a>&nbsp;&nbsp;
95
+ </div>
96
+ </div>
97
+
98
+ </div>
99
+
100
+
101
+ <!-- if includes -->
102
+
103
+ <div id="section">
104
+
105
+
106
+
107
+
108
+
109
+
110
+
111
+
112
+ <!-- if method_list -->
113
+ <div id="methods">
114
+ <h3 class="section-bar">Public Class methods</h3>
115
+
116
+ <div id="method-M000015" class="method-detail">
117
+ <a name="M000015"></a>
118
+
119
+ <div class="method-heading">
120
+ <a href="#M000015" class="method-signature">
121
+ <span class="method-name">to_url</span><span class="method-args">()</span>
122
+ </a>
123
+ </div>
124
+
125
+ <div class="method-description">
126
+ <p><a class="source-toggle" href="#"
127
+ onclick="toggleCode('M000015-source');return false;">[Source]</a></p>
128
+ <div class="method-source-code" id="M000015-source">
129
+ <pre>
130
+ <span class="ruby-comment cmt"># File lib/violet/request.rb, line 283</span>
131
+ 283: <span class="ruby-keyword kw">def</span> <span class="ruby-constant">GET_EARS_POSITION</span>.<span class="ruby-identifier">to_url</span>
132
+ 284: <span class="ruby-value str">'ears=ok'</span>
133
+ 285: <span class="ruby-keyword kw">end</span>
134
+ </pre>
135
+ </div>
136
+ </div>
137
+ </div>
138
+
139
+
140
+ </div>
141
+
142
+
143
+ </div>
144
+
145
+
146
+ <div id="validator-badges">
147
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
148
+ </div>
149
+
150
+ </body>
151
+ </html>
@@ -0,0 +1,244 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
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: Request::Query</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
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">Request::Query</td>
54
+ </tr>
55
+ <tr class="top-aligned-row">
56
+ <td><strong>In:</strong></td>
57
+ <td>
58
+ <a href="../../files/lib/violet/request_rb.html">
59
+ lib/violet/request.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
+ <div id="diagram">
81
+ <map id="map" name="map">
82
+ <area shape="rect" coords="392,85,464,133" href="Base/Event.html" alt="Event" />
83
+ <area shape="rect" coords="27,181,99,229" href="Action.html" alt="Action" />
84
+ <area shape="rect" coords="123,181,211,229" href="TtsMessage.html" alt="TtsMessage" />
85
+ <area shape="rect" coords="235,181,341,229" href="SetEarsPosition.html" alt="SetEarsPosition" />
86
+ <area shape="rect" coords="365,181,469,229" href="Base/EventCollection.html" alt="EventCollection" />
87
+ <area shape="rect" coords="647,85,724,133" href="../Enumerable.html" alt="Enumerable" />
88
+ <area shape="rect" coords="135,85,207,133" href="Query.html" alt="Query" />
89
+ <area shape="rect" coords="491,73,625,121" href="GET_EARS_POSITION.html" alt="GET_EARS_POSITION" />
90
+ <area shape="rect" coords="355,51,480,240" href="Base.html" alt="Base" />
91
+ <area shape="rect" coords="16,16,636,251" href="../Request.html" alt="Request" />
92
+ </map>
93
+ <img src="../../dot/f_8.png" usemap="#map" border="0" alt="dot/f_8.png">
94
+ </div>
95
+
96
+ <div id="description">
97
+ <p>
98
+ this class is used to &quot;translate&quot; our Events into URLs. Examples:
99
+ </p>
100
+ <pre>
101
+ TODO
102
+ </pre>
103
+ <p>
104
+ see <a
105
+ href="http://api.nabaztag.com/docs/home.html">api.nabaztag.com/docs/home.html</a>
106
+ </p>
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="#M000024">new</a>&nbsp;&nbsp;
118
+ <a href="#M000026">send!</a>&nbsp;&nbsp;
119
+ <a href="#M000025">to_url</a>&nbsp;&nbsp;
120
+ </div>
121
+ </div>
122
+
123
+ </div>
124
+
125
+
126
+ <!-- if includes -->
127
+
128
+ <div id="section">
129
+
130
+
131
+
132
+
133
+
134
+
135
+
136
+
137
+ <!-- if method_list -->
138
+ <div id="methods">
139
+ <h3 class="section-bar">Public Class methods</h3>
140
+
141
+ <div id="method-M000024" class="method-detail">
142
+ <a name="M000024"></a>
143
+
144
+ <div class="method-heading">
145
+ <a href="#M000024" class="method-signature">
146
+ <span class="method-name">new</span><span class="method-args">(h)</span>
147
+ </a>
148
+ </div>
149
+
150
+ <div class="method-description">
151
+ <p>
152
+ create a <a href="Query.html#M000024">new</a> <a
153
+ href="Query.html">Query</a> object with the give parameters.
154
+ <tt>serial</tt> and <tt>token</tt> parameters should be checked at a higher
155
+ level. <tt>event</tt> parameter is usually an Event object, but you can
156
+ give any Object that respond to <a href="Query.html#M000025">to_url</a>.
157
+ </p>
158
+ <p><a class="source-toggle" href="#"
159
+ onclick="toggleCode('M000024-source');return false;">[Source]</a></p>
160
+ <div class="method-source-code" id="M000024-source">
161
+ <pre>
162
+ <span class="ruby-comment cmt"># File lib/violet/request.rb, line 87</span>
163
+ 87: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span> <span class="ruby-identifier">h</span>
164
+ 88: <span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value str">'event parameter has no &quot;to_url&quot; method or is empty'</span>) <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">h</span>[<span class="ruby-identifier">:event</span>] <span class="ruby-keyword kw">and</span> <span class="ruby-identifier">h</span>[<span class="ruby-identifier">:event</span>].<span class="ruby-identifier">respond_to?</span>(<span class="ruby-identifier">:to_url</span>)
165
+ 89: <span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value str">'need a :serial'</span>) <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">h</span>[<span class="ruby-identifier">:serial</span>]
166
+ 90: <span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value str">'need a :token'</span> ) <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">h</span>[<span class="ruby-identifier">:token</span>]
167
+ 91:
168
+ 92: <span class="ruby-ivar">@event</span>, <span class="ruby-ivar">@serial</span>, <span class="ruby-ivar">@token</span> = <span class="ruby-identifier">h</span>[<span class="ruby-identifier">:event</span>], <span class="ruby-identifier">h</span>[<span class="ruby-identifier">:serial</span>], <span class="ruby-identifier">h</span>[<span class="ruby-identifier">:token</span>]
169
+ 93: <span class="ruby-keyword kw">end</span>
170
+ </pre>
171
+ </div>
172
+ </div>
173
+ </div>
174
+
175
+ <h3 class="section-bar">Public Instance methods</h3>
176
+
177
+ <div id="method-M000026" class="method-detail">
178
+ <a name="M000026"></a>
179
+
180
+ <div class="method-heading">
181
+ <a href="#M000026" class="method-signature">
182
+ <span class="method-name">send!</span><span class="method-args">(response_type=nil)</span>
183
+ </a>
184
+ </div>
185
+
186
+ <div class="method-description">
187
+ <p>
188
+ TODO
189
+ </p>
190
+ <p><a class="source-toggle" href="#"
191
+ onclick="toggleCode('M000026-source');return false;">[Source]</a></p>
192
+ <div class="method-source-code" id="M000026-source">
193
+ <pre>
194
+ <span class="ruby-comment cmt"># File lib/violet/request.rb, line 101</span>
195
+ 101: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">send!</span> <span class="ruby-identifier">response_type</span>=<span class="ruby-keyword kw">nil</span>
196
+ 102: <span class="ruby-comment cmt"># TODO: rescue ?</span>
197
+ 103: <span class="ruby-identifier">rsp</span> = <span class="ruby-identifier">open</span>(<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">to_url</span>) { <span class="ruby-operator">|</span><span class="ruby-identifier">rsp</span><span class="ruby-operator">|</span> <span class="ruby-identifier">rsp</span>.<span class="ruby-identifier">read</span> }
198
+ 104: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">response_type</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">:xml</span> <span class="ruby-keyword kw">then</span> <span class="ruby-identifier">rsp</span> <span class="ruby-keyword kw">else</span> <span class="ruby-constant">Response</span>.<span class="ruby-identifier">parse</span>(<span class="ruby-identifier">rsp</span>) <span class="ruby-keyword kw">end</span>
199
+ 105: <span class="ruby-keyword kw">end</span>
200
+ </pre>
201
+ </div>
202
+ </div>
203
+ </div>
204
+
205
+ <div id="method-M000025" class="method-detail">
206
+ <a name="M000025"></a>
207
+
208
+ <div class="method-heading">
209
+ <a href="#M000025" class="method-signature">
210
+ <span class="method-name">to_url</span><span class="method-args">()</span>
211
+ </a>
212
+ </div>
213
+
214
+ <div class="method-description">
215
+ <p>
216
+ return the complet url: API_URL with the <tt>serial</tt>, <tt>token</tt>
217
+ and options.
218
+ </p>
219
+ <p><a class="source-toggle" href="#"
220
+ onclick="toggleCode('M000025-source');return false;">[Source]</a></p>
221
+ <div class="method-source-code" id="M000025-source">
222
+ <pre>
223
+ <span class="ruby-comment cmt"># File lib/violet/request.rb, line 96</span>
224
+ 96: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_url</span>
225
+ 97: <span class="ruby-constant">API_URL</span><span class="ruby-operator">+</span><span class="ruby-value str">'?'</span> <span class="ruby-operator">&lt;&lt;</span> [ <span class="ruby-node">&quot;token=#{@token}&quot;</span>, <span class="ruby-node">&quot;sn=#{@serial}&quot;</span>, <span class="ruby-ivar">@event</span>.<span class="ruby-identifier">to_url</span> ].<span class="ruby-identifier">join</span>(<span class="ruby-value str">'&amp;'</span>)
226
+ 98: <span class="ruby-keyword kw">end</span>
227
+ </pre>
228
+ </div>
229
+ </div>
230
+ </div>
231
+
232
+
233
+ </div>
234
+
235
+
236
+ </div>
237
+
238
+
239
+ <div id="validator-badges">
240
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
241
+ </div>
242
+
243
+ </body>
244
+ </html>
@@ -0,0 +1,213 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
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: Request::SetEarsPosition</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
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">Request::SetEarsPosition</td>
54
+ </tr>
55
+ <tr class="top-aligned-row">
56
+ <td><strong>In:</strong></td>
57
+ <td>
58
+ <a href="../../files/lib/violet/request_rb.html">
59
+ lib/violet/request.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
+ <a href="Base/Event.html">
69
+ Base::Event
70
+ </a>
71
+ </td>
72
+ </tr>
73
+ </table>
74
+ </div>
75
+ <!-- banner header -->
76
+
77
+ <div id="bodyContent">
78
+
79
+
80
+
81
+ <div id="contextContent">
82
+ <div id="diagram">
83
+ <map id="map" name="map">
84
+ <area shape="rect" coords="392,85,464,133" href="Base/Event.html" alt="Event" />
85
+ <area shape="rect" coords="27,181,99,229" href="Action.html" alt="Action" />
86
+ <area shape="rect" coords="123,181,211,229" href="TtsMessage.html" alt="TtsMessage" />
87
+ <area shape="rect" coords="235,181,341,229" href="SetEarsPosition.html" alt="SetEarsPosition" />
88
+ <area shape="rect" coords="365,181,469,229" href="Base/EventCollection.html" alt="EventCollection" />
89
+ <area shape="rect" coords="647,85,724,133" href="../Enumerable.html" alt="Enumerable" />
90
+ <area shape="rect" coords="135,85,207,133" href="Query.html" alt="Query" />
91
+ <area shape="rect" coords="491,73,625,121" href="GET_EARS_POSITION.html" alt="GET_EARS_POSITION" />
92
+ <area shape="rect" coords="355,51,480,240" href="Base.html" alt="Base" />
93
+ <area shape="rect" coords="16,16,636,251" href="../Request.html" alt="Request" />
94
+ </map>
95
+ <img src="../../dot/f_8.png" usemap="#map" border="0" alt="dot/f_8.png">
96
+ </div>
97
+
98
+
99
+
100
+ </div>
101
+
102
+ <div id="method-list">
103
+ <h3 class="section-bar">Methods</h3>
104
+
105
+ <div class="name-list">
106
+ <a href="#M000029">new</a>&nbsp;&nbsp;
107
+ <a href="#M000030">to_url</a>&nbsp;&nbsp;
108
+ </div>
109
+ </div>
110
+
111
+ </div>
112
+
113
+
114
+ <!-- if includes -->
115
+
116
+ <div id="section">
117
+
118
+
119
+ <div id="constants-list">
120
+ <h3 class="section-bar">Constants</h3>
121
+
122
+ <div class="name-list">
123
+ <table summary="Constants">
124
+ <tr class="top-aligned-row context-row">
125
+ <td class="context-item-name">MIN_POS</td>
126
+ <td>=</td>
127
+ <td class="context-item-value">0</td>
128
+ </tr>
129
+ <tr class="top-aligned-row context-row">
130
+ <td class="context-item-name">MAX_POS</td>
131
+ <td>=</td>
132
+ <td class="context-item-value">16</td>
133
+ </tr>
134
+ </table>
135
+ </div>
136
+ </div>
137
+
138
+
139
+
140
+
141
+
142
+
143
+ <!-- if method_list -->
144
+ <div id="methods">
145
+ <h3 class="section-bar">Public Class methods</h3>
146
+
147
+ <div id="method-M000029" class="method-detail">
148
+ <a name="M000029"></a>
149
+
150
+ <div class="method-heading">
151
+ <a href="#M000029" class="method-signature">
152
+ <span class="method-name">new</span><span class="method-args">(h)</span>
153
+ </a>
154
+ </div>
155
+
156
+ <div class="method-description">
157
+ <p><a class="source-toggle" href="#"
158
+ onclick="toggleCode('M000029-source');return false;">[Source]</a></p>
159
+ <div class="method-source-code" id="M000029-source">
160
+ <pre>
161
+ <span class="ruby-comment cmt"># File lib/violet/request.rb, line 114</span>
162
+ 114: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span> <span class="ruby-identifier">h</span>
163
+ 115: <span class="ruby-ivar">@h</span> = <span class="ruby-identifier">h</span>.<span class="ruby-identifier">dup</span>
164
+ 116: <span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value str">'at least :posright or :posleft must be set'</span>) <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@h</span>[<span class="ruby-identifier">:posleft</span>] <span class="ruby-keyword kw">or</span> <span class="ruby-ivar">@h</span>[<span class="ruby-identifier">:posright</span>]
165
+ 117: <span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>.<span class="ruby-identifier">new</span>(<span class="ruby-node">&quot;:posright must be between #{MIN_POS} and #{MAX_POS}&quot;</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@h</span>[<span class="ruby-identifier">:posright</span>] <span class="ruby-keyword kw">and</span> <span class="ruby-keyword kw">not</span> <span class="ruby-ivar">@h</span>[<span class="ruby-identifier">:posright</span>].<span class="ruby-identifier">to_i</span>.<span class="ruby-identifier">between?</span>(<span class="ruby-constant">MIN_POS</span>,<span class="ruby-constant">MAX_POS</span>)
166
+ 118: <span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>.<span class="ruby-identifier">new</span>(<span class="ruby-node">&quot;:posleft must be between #{MIN_POS} and #{MAX_POS}&quot;</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@h</span>[<span class="ruby-identifier">:posleft</span> ] <span class="ruby-keyword kw">and</span> <span class="ruby-keyword kw">not</span> <span class="ruby-ivar">@h</span>[<span class="ruby-identifier">:posleft</span> ].<span class="ruby-identifier">to_i</span>.<span class="ruby-identifier">between?</span>(<span class="ruby-constant">MIN_POS</span>,<span class="ruby-constant">MAX_POS</span>)
167
+ 119: <span class="ruby-keyword kw">end</span>
168
+ </pre>
169
+ </div>
170
+ </div>
171
+ </div>
172
+
173
+ <h3 class="section-bar">Public Instance methods</h3>
174
+
175
+ <div id="method-M000030" class="method-detail">
176
+ <a name="M000030"></a>
177
+
178
+ <div class="method-heading">
179
+ <a href="#M000030" class="method-signature">
180
+ <span class="method-name">to_url</span><span class="method-args">()</span>
181
+ </a>
182
+ </div>
183
+
184
+ <div class="method-description">
185
+ <p><a class="source-toggle" href="#"
186
+ onclick="toggleCode('M000030-source');return false;">[Source]</a></p>
187
+ <div class="method-source-code" id="M000030-source">
188
+ <pre>
189
+ <span class="ruby-comment cmt"># File lib/violet/request.rb, line 122</span>
190
+ 122: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_url</span>
191
+ 123: <span class="ruby-identifier">url</span> = <span class="ruby-constant">Array</span>.<span class="ruby-identifier">new</span>
192
+ 124: <span class="ruby-identifier">url</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot;posleft=#{h[:posleft].to_i}&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">h</span>[<span class="ruby-identifier">:posleft</span>]
193
+ 125: <span class="ruby-identifier">url</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot;posright=#{h[:posright].to_i}&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">h</span>[<span class="ruby-identifier">:posright</span>]
194
+ 126: <span class="ruby-identifier">url</span>.<span class="ruby-identifier">join</span>(<span class="ruby-value str">'&amp;'</span>)
195
+ 127: <span class="ruby-keyword kw">end</span>
196
+ </pre>
197
+ </div>
198
+ </div>
199
+ </div>
200
+
201
+
202
+ </div>
203
+
204
+
205
+ </div>
206
+
207
+
208
+ <div id="validator-badges">
209
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
210
+ </div>
211
+
212
+ </body>
213
+ </html>