sdl4r 0.9.6 → 0.9.7
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.
- data/CHANGELOG +49 -2
- data/Rakefile +35 -5
- data/TODO +29 -3
- data/doc/classes/SDL4R.html +386 -674
- data/doc/classes/SDL4R/Parser.html +183 -307
- data/doc/classes/SDL4R/ParserTest.html +357 -0
- data/doc/classes/SDL4R/SDL4RTest.html +532 -0
- data/doc/classes/SDL4R/SDLTest.html +77 -0
- data/doc/classes/SDL4R/SdlBinary.html +180 -295
- data/doc/classes/SDL4R/SdlParseError.html +105 -180
- data/doc/classes/SDL4R/SdlTimeSpan.html +628 -939
- data/doc/classes/SDL4R/Tag.html +1236 -2036
- data/doc/classes/SDL4R/TagTest.html +292 -0
- data/doc/created.rid +1 -1
- data/doc/files/CHANGELOG.html +183 -184
- data/doc/files/LICENSE.html +496 -755
- data/doc/files/README.html +399 -623
- data/doc/files/lib/sdl4r/parser/reader_rb.html +53 -106
- data/doc/files/lib/sdl4r/parser/time_span_with_zone_rb.html +53 -106
- data/doc/files/lib/sdl4r/parser/token_rb.html +53 -106
- data/doc/files/lib/sdl4r/parser/tokenizer_rb.html +53 -106
- data/doc/files/lib/sdl4r/parser_rb.html +60 -112
- data/doc/files/lib/sdl4r/sdl4r_rb.html +62 -114
- data/doc/files/lib/sdl4r/sdl_binary_rb.html +53 -106
- data/doc/files/lib/sdl4r/sdl_parse_error_rb.html +53 -106
- data/doc/files/lib/sdl4r/sdl_time_span_rb.html +53 -106
- data/doc/files/lib/sdl4r/tag_rb.html +62 -114
- data/doc/files/lib/sdl4r_rb.html +53 -106
- data/doc/files/test/sdl4r/parser_test_rb.html +63 -0
- data/doc/files/test/sdl4r/sdl4r_test_rb.html +66 -0
- data/doc/files/test/sdl4r/sdl_test_rb.html +63 -0
- data/doc/files/test/sdl4r/tag_test_rb.html +63 -0
- data/doc/fr_class_index.html +19 -32
- data/doc/fr_file_index.html +37 -40
- data/doc/fr_method_index.html +4707 -114
- data/doc/index.html +14 -23
- data/doc/rdoc-style.css +323 -203
- data/lib/sdl4r/parser/reader.rb +26 -19
- data/lib/sdl4r/parser/token.rb +3 -3
- data/lib/sdl4r/parser/tokenizer.rb +93 -98
- data/lib/sdl4r/sdl_parse_error.rb +2 -2
- data/lib/sdl4r/tag.rb +127 -73
- data/test/sdl4r/parser_test.rb +109 -11
- data/test/sdl4r/tag_test.rb +73 -4
- metadata +15 -12
@@ -0,0 +1,77 @@
|
|
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>: SDL4R::SDLTest [RDoc: Simple Declarative Language for Ruby]</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
|
+
SDL4R::SDLTest
|
31
|
+
</h1>
|
32
|
+
<ol class='paths'>
|
33
|
+
<li>
|
34
|
+
<a href="../../files/test/sdl4r/sdl_test_rb.html">test/sdl4r/sdl_test.rb</a>
|
35
|
+
</li>
|
36
|
+
</ol>
|
37
|
+
<div class='parent'>
|
38
|
+
Parent:
|
39
|
+
<strong>Test::Unit::TestCase</strong>
|
40
|
+
</div>
|
41
|
+
</div>
|
42
|
+
<div id='content'>
|
43
|
+
<div id='text'>
|
44
|
+
<div id='method-list'>
|
45
|
+
<h2>Methods</h2>
|
46
|
+
<h3>public instance</h3>
|
47
|
+
<ol>
|
48
|
+
<li><a href="#M000127">test_coerce_or_fail</a></li>
|
49
|
+
</ol>
|
50
|
+
</div>
|
51
|
+
<div id='section'>
|
52
|
+
<div id='methods'>
|
53
|
+
<h2>Public instance methods</h2>
|
54
|
+
<div class='method public-instance' id='method-M000127'>
|
55
|
+
<a name='M000127'></a>
|
56
|
+
<div class='synopsis'>
|
57
|
+
<span class='name'>test_coerce_or_fail</span>
|
58
|
+
<span class='arguments'>()</span>
|
59
|
+
</div>
|
60
|
+
<div class='source'>
|
61
|
+
<a class='source-toggle' href='#' onclick="toggleCode('M000127-source'); return false">
|
62
|
+
[show source]
|
63
|
+
</a>
|
64
|
+
<pre id='M000127-source'> <span class="ruby-comment cmt"># File test/sdl4r/sdl_test.rb, line 30</span>
30: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">test_coerce_or_fail</span>
31: <span class="ruby-comment cmt"># Most basic types are considered to be tested in other tests (like ParserTest)</span>
32: <span class="ruby-identifier">tag</span> = <span class="ruby-constant">Tag</span>.<span class="ruby-identifier">new</span> <span class="ruby-value str">"tag1"</span>
33: <span class="ruby-identifier">assert_raise</span> <span class="ruby-constant">ArgumentError</span> <span class="ruby-keyword kw">do</span> <span class="ruby-identifier">tag</span>.<span class="ruby-identifier">add_value</span>(<span class="ruby-constant">Object</span>.<span class="ruby-identifier">new</span>) <span class="ruby-keyword kw">end</span>
34: <span class="ruby-identifier">assert_raise</span> <span class="ruby-constant">ArgumentError</span> <span class="ruby-keyword kw">do</span> <span class="ruby-identifier">tag</span>.<span class="ruby-identifier">add_value</span>([<span class="ruby-value">1</span>, <span class="ruby-value">2</span>, <span class="ruby-value">3</span>]) <span class="ruby-keyword kw">end</span>
35: <span class="ruby-identifier">assert_raise</span> <span class="ruby-constant">ArgumentError</span> <span class="ruby-keyword kw">do</span> <span class="ruby-identifier">tag</span>.<span class="ruby-identifier">add_value</span>({<span class="ruby-value str">"a"</span> =<span class="ruby-operator">></span> <span class="ruby-value str">"b"</span>}) <span class="ruby-keyword kw">end</span>
36: 
37: <span class="ruby-comment cmt"># check translation of Rational</span>
38: <span class="ruby-identifier">tag</span>.<span class="ruby-identifier">add_value</span>(<span class="ruby-constant">Rational</span>(<span class="ruby-value">3</span>, <span class="ruby-value">10</span>))
39: <span class="ruby-identifier">assert_equal</span> [<span class="ruby-value">0</span><span class="ruby-value">.3</span>], <span class="ruby-identifier">tag</span>.<span class="ruby-identifier">values</span>
40: <span class="ruby-keyword kw">end</span></pre>
|
65
|
+
</div>
|
66
|
+
</div>
|
67
|
+
</div>
|
68
|
+
</div>
|
69
|
+
</div>
|
70
|
+
</div>
|
71
|
+
<div id='footer-push'></div>
|
72
|
+
</div>
|
73
|
+
<div id='footer'>
|
74
|
+
<a href="http://github.com/mislav/hanna/tree/master"><strong>Hanna</strong> RDoc template</a>
|
75
|
+
</div>
|
76
|
+
</body>
|
77
|
+
</html>
|
@@ -1,303 +1,188 @@
|
|
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">SDL4R::SdlBinary</td>
|
54
|
-
</tr>
|
55
|
-
<tr class="top-aligned-row">
|
56
|
-
<td><strong>In:</strong></td>
|
57
|
-
<td>
|
58
|
-
<a href="../../files/lib/sdl4r/sdl_binary_rb.html">
|
59
|
-
lib/sdl4r/sdl_binary.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
|
-
Represents a binary value.
|
84
|
-
</p>
|
85
|
-
<p>
|
86
|
-
This class was introduced to avoid the confusion between a Ruby String and
|
87
|
-
a binary literal.
|
88
|
-
</p>
|
89
|
-
|
90
|
-
</div>
|
91
|
-
|
92
|
-
|
93
|
-
</div>
|
94
|
-
|
95
|
-
<div id="method-list">
|
96
|
-
<h3 class="section-bar">Methods</h3>
|
97
|
-
|
98
|
-
<div class="name-list">
|
99
|
-
<a href="#M000056">==</a>
|
100
|
-
<a href="#M000060">decode64</a>
|
101
|
-
<a href="#M000057">eql?</a>
|
102
|
-
<a href="#M000058">hash</a>
|
103
|
-
<a href="#M000055">new</a>
|
104
|
-
<a href="#M000059">to_s</a>
|
105
|
-
</div>
|
106
|
-
</div>
|
107
|
-
|
108
|
-
</div>
|
109
|
-
|
110
|
-
|
111
|
-
<!-- if includes -->
|
112
|
-
|
113
|
-
<div id="section">
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
<div id="attribute-list">
|
120
|
-
<h3 class="section-bar">Attributes</h3>
|
121
|
-
|
122
|
-
<div class="name-list">
|
123
|
-
<table>
|
124
|
-
<tr class="top-aligned-row context-row">
|
125
|
-
<td class="context-item-name">bytes</td>
|
126
|
-
<td class="context-item-value"> [RW] </td>
|
127
|
-
<td class="context-item-desc"></td>
|
128
|
-
</tr>
|
129
|
-
</table>
|
130
|
-
</div>
|
131
|
-
</div>
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
<!-- if method_list -->
|
136
|
-
<div id="methods">
|
137
|
-
<h3 class="section-bar">Public Class methods</h3>
|
138
|
-
|
139
|
-
<div id="method-M000060" class="method-detail">
|
140
|
-
<a name="M000060"></a>
|
141
|
-
|
142
|
-
<div class="method-heading">
|
143
|
-
<a href="#M000060" class="method-signature">
|
144
|
-
<span class="method-name">decode64</span><span class="method-args">(s)</span>
|
145
|
-
</a>
|
146
|
-
</div>
|
147
|
-
|
148
|
-
<div class="method-description">
|
149
|
-
<p>
|
150
|
-
Decodes the specified base-64 encoded string and returns a corresponding <a
|
151
|
-
href="SdlBinary.html">SdlBinary</a> instance. <tt>s</tt> might not include
|
152
|
-
the conventional starting and ending square brackets.
|
153
|
-
</p>
|
154
|
-
<p><a class="source-toggle" href="#"
|
155
|
-
onclick="toggleCode('M000060-source');return false;">[Source]</a></p>
|
156
|
-
<div class="method-source-code" id="M000060-source">
|
157
|
-
<pre>
|
158
|
-
<span class="ruby-comment cmt"># File lib/sdl4r/sdl_binary.rb, line 57</span>
|
159
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">decode64</span>(<span class="ruby-identifier">s</span>)
|
160
|
-
<span class="ruby-identifier">s</span> = <span class="ruby-identifier">s</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-value str">"\n\r\t "</span>)
|
161
|
-
|
162
|
-
<span class="ruby-identifier">binary</span> = <span class="ruby-constant">Base64</span>.<span class="ruby-identifier">decode64</span>(<span class="ruby-identifier">s</span>)
|
163
|
-
|
164
|
-
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">binary</span>.<span class="ruby-identifier">empty?</span> <span class="ruby-keyword kw">and</span> <span class="ruby-keyword kw">not</span> <span class="ruby-identifier">s</span>.<span class="ruby-identifier">empty?</span>
|
165
|
-
<span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-value str">"bad binary literal"</span>
|
166
|
-
<span class="ruby-keyword kw">end</span>
|
167
|
-
|
168
|
-
<span class="ruby-keyword kw">return</span> <span class="ruby-constant">SdlBinary</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">binary</span>)
|
169
|
-
<span class="ruby-keyword kw">end</span>
|
170
|
-
</pre>
|
171
|
-
</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>: SDL4R::SdlBinary [RDoc: Simple Declarative Language for Ruby]</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
|
+
SDL4R::SdlBinary
|
31
|
+
</h1>
|
32
|
+
<ol class='paths'>
|
33
|
+
<li>
|
34
|
+
<a href="../../files/lib/sdl4r/sdl_binary_rb.html">lib/sdl4r/sdl_binary.rb</a>
|
35
|
+
</li>
|
36
|
+
</ol>
|
37
|
+
<div class='parent'>
|
38
|
+
Parent:
|
39
|
+
<strong>Object</strong>
|
172
40
|
</div>
|
173
41
|
</div>
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
<div class="method-description">
|
185
|
-
<p>
|
186
|
-
<tt>value</tt>: a String containing the bytes
|
187
|
-
</p>
|
188
|
-
<p><a class="source-toggle" href="#"
|
189
|
-
onclick="toggleCode('M000055-source');return false;">[Source]</a></p>
|
190
|
-
<div class="method-source-code" id="M000055-source">
|
191
|
-
<pre>
|
192
|
-
<span class="ruby-comment cmt"># File lib/sdl4r/sdl_binary.rb, line 33</span>
|
193
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">bytes</span>)
|
194
|
-
<span class="ruby-ivar">@bytes</span> = <span class="ruby-identifier">bytes</span>
|
195
|
-
<span class="ruby-keyword kw">end</span>
|
196
|
-
</pre>
|
42
|
+
<div id='content'>
|
43
|
+
<div id='text'>
|
44
|
+
<div id='description'>
|
45
|
+
<p>
|
46
|
+
Represents a binary value.
|
47
|
+
</p>
|
48
|
+
<p>
|
49
|
+
This class was introduced to avoid the confusion between a Ruby String and
|
50
|
+
a binary literal.
|
51
|
+
</p>
|
197
52
|
</div>
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
<div class="method-description">
|
213
|
-
<p><a class="source-toggle" href="#"
|
214
|
-
onclick="toggleCode('M000056-source');return false;">[Source]</a></p>
|
215
|
-
<div class="method-source-code" id="M000056-source">
|
216
|
-
<pre>
|
217
|
-
<span class="ruby-comment cmt"># File lib/sdl4r/sdl_binary.rb, line 37</span>
|
218
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-operator">==</span>(<span class="ruby-identifier">o</span>)
|
219
|
-
<span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">true</span> <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">equal?</span>(<span class="ruby-identifier">o</span>)
|
220
|
-
<span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span> <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">not</span> <span class="ruby-identifier">o</span>.<span class="ruby-identifier">instance_of?</span>(<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>)
|
221
|
-
<span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">bytes</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">o</span>.<span class="ruby-identifier">bytes</span>
|
222
|
-
<span class="ruby-keyword kw">end</span>
|
223
|
-
</pre>
|
53
|
+
<div id='method-list'>
|
54
|
+
<h2>Methods</h2>
|
55
|
+
<h3>public class</h3>
|
56
|
+
<ol>
|
57
|
+
<li><a href="#M000089">decode64</a></li>
|
58
|
+
<li><a href="#M000084">new</a></li>
|
59
|
+
</ol>
|
60
|
+
<h3>public instance</h3>
|
61
|
+
<ol>
|
62
|
+
<li><a href="#M000085">==</a></li>
|
63
|
+
<li><a href="#M000086">eql?</a></li>
|
64
|
+
<li><a href="#M000087">hash</a></li>
|
65
|
+
<li><a href="#M000088">to_s</a></li>
|
66
|
+
</ol>
|
224
67
|
</div>
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">
|
258
|
-
|
259
|
-
|
260
|
-
|
68
|
+
<div id='section'>
|
69
|
+
<div id='attribute-list'>
|
70
|
+
<h2 class='section-bar'>Attributes</h2>
|
71
|
+
<div class='name-list'>
|
72
|
+
<table>
|
73
|
+
<tr class='top-aligned-row context-row'>
|
74
|
+
<td class='context-item-name'>bytes</td>
|
75
|
+
<td class='context-item-value'>[RW]</td>
|
76
|
+
<td class='context-item-desc'></td>
|
77
|
+
</tr>
|
78
|
+
</table>
|
79
|
+
</div>
|
80
|
+
</div>
|
81
|
+
<div id='methods'>
|
82
|
+
<h2>Public class methods</h2>
|
83
|
+
<div class='method public-class' id='method-M000089'>
|
84
|
+
<a name='M000089'></a>
|
85
|
+
<div class='synopsis'>
|
86
|
+
<span class='name'>decode64</span>
|
87
|
+
<span class='arguments'>(s)</span>
|
88
|
+
</div>
|
89
|
+
<div class='description'>
|
90
|
+
<p>
|
91
|
+
Decodes the specified base-64 encoded string and returns a corresponding <a
|
92
|
+
href="SdlBinary.html">SdlBinary</a> instance. <tt>s</tt> might not include
|
93
|
+
the conventional starting and ending square brackets.
|
94
|
+
</p>
|
95
|
+
</div>
|
96
|
+
<div class='source'>
|
97
|
+
<a class='source-toggle' href='#' onclick="toggleCode('M000089-source'); return false">
|
98
|
+
[show source]
|
99
|
+
</a>
|
100
|
+
<pre id='M000089-source'> <span class="ruby-comment cmt"># File lib/sdl4r/sdl_binary.rb, line 57</span>
57: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">decode64</span>(<span class="ruby-identifier">s</span>)
58: <span class="ruby-identifier">s</span> = <span class="ruby-identifier">s</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-value str">"\n\r\t "</span>)
59: 
60: <span class="ruby-identifier">binary</span> = <span class="ruby-constant">Base64</span>.<span class="ruby-identifier">decode64</span>(<span class="ruby-identifier">s</span>)
61: 
62: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">binary</span>.<span class="ruby-identifier">empty?</span> <span class="ruby-keyword kw">and</span> <span class="ruby-keyword kw">not</span> <span class="ruby-identifier">s</span>.<span class="ruby-identifier">empty?</span>
63: <span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-value str">"bad binary literal"</span>
64: <span class="ruby-keyword kw">end</span>
65: 
66: <span class="ruby-keyword kw">return</span> <span class="ruby-constant">SdlBinary</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">binary</span>)
67: <span class="ruby-keyword kw">end</span></pre>
|
101
|
+
</div>
|
102
|
+
</div>
|
103
|
+
<div class='method public-class' id='method-M000084'>
|
104
|
+
<a name='M000084'></a>
|
105
|
+
<div class='synopsis'>
|
106
|
+
<span class='name'>new</span>
|
107
|
+
<span class='arguments'>(bytes)</span>
|
108
|
+
</div>
|
109
|
+
<div class='description'>
|
110
|
+
<p>
|
111
|
+
<tt>value</tt>: a String containing the bytes
|
112
|
+
</p>
|
113
|
+
</div>
|
114
|
+
<div class='source'>
|
115
|
+
<a class='source-toggle' href='#' onclick="toggleCode('M000084-source'); return false">
|
116
|
+
[show source]
|
117
|
+
</a>
|
118
|
+
<pre id='M000084-source'> <span class="ruby-comment cmt"># File lib/sdl4r/sdl_binary.rb, line 33</span>
33: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">bytes</span>)
34: <span class="ruby-ivar">@bytes</span> = <span class="ruby-identifier">bytes</span>
35: <span class="ruby-keyword kw">end</span></pre>
|
119
|
+
</div>
|
120
|
+
</div>
|
121
|
+
<h2>Public instance methods</h2>
|
122
|
+
<div class='method public-instance' id='method-M000085'>
|
123
|
+
<a name='M000085'></a>
|
124
|
+
<div class='synopsis'>
|
125
|
+
<span class='name'>==</span>
|
126
|
+
<span class='arguments'>(o)</span>
|
127
|
+
</div>
|
128
|
+
<div class='source'>
|
129
|
+
<a class='source-toggle' href='#' onclick="toggleCode('M000085-source'); return false">
|
130
|
+
[show source]
|
131
|
+
</a>
|
132
|
+
<pre id='M000085-source'> <span class="ruby-comment cmt"># File lib/sdl4r/sdl_binary.rb, line 37</span>
37: <span class="ruby-keyword kw">def</span> <span class="ruby-operator">==</span>(<span class="ruby-identifier">o</span>)
38: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">true</span> <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">equal?</span>(<span class="ruby-identifier">o</span>)
39: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span> <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">not</span> <span class="ruby-identifier">o</span>.<span class="ruby-identifier">instance_of?</span>(<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>)
40: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">bytes</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">o</span>.<span class="ruby-identifier">bytes</span>
41: <span class="ruby-keyword kw">end</span></pre>
|
133
|
+
</div>
|
134
|
+
</div>
|
135
|
+
<div class='method public-instance' id='method-M000086'>
|
136
|
+
<a name='M000086'></a>
|
137
|
+
<div class='synopsis'>
|
138
|
+
<span class='name'>eql?</span>
|
139
|
+
<span class='arguments'>(o)</span>
|
140
|
+
</div>
|
141
|
+
<div class='description'>
|
142
|
+
<p>
|
143
|
+
Alias for #==
|
144
|
+
</p>
|
145
|
+
</div>
|
146
|
+
</div>
|
147
|
+
<div class='method public-instance' id='method-M000087'>
|
148
|
+
<a name='M000087'></a>
|
149
|
+
<div class='synopsis'>
|
150
|
+
<span class='name'>hash</span>
|
151
|
+
<span class='arguments'>()</span>
|
152
|
+
</div>
|
153
|
+
<div class='source'>
|
154
|
+
<a class='source-toggle' href='#' onclick="toggleCode('M000087-source'); return false">
|
155
|
+
[show source]
|
156
|
+
</a>
|
157
|
+
<pre id='M000087-source'> <span class="ruby-comment cmt"># File lib/sdl4r/sdl_binary.rb, line 45</span>
45: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">hash</span>
46: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">bytes</span>.<span class="ruby-identifier">hash</span>
47: <span class="ruby-keyword kw">end</span></pre>
|
158
|
+
</div>
|
159
|
+
</div>
|
160
|
+
<div class='method public-instance' id='method-M000088'>
|
161
|
+
<a name='M000088'></a>
|
162
|
+
<div class='synopsis'>
|
163
|
+
<span class='name'>to_s</span>
|
164
|
+
<span class='arguments'>()</span>
|
165
|
+
</div>
|
166
|
+
<div class='description'>
|
167
|
+
<p>
|
168
|
+
Returns the bytes base64-encoded.
|
169
|
+
</p>
|
170
|
+
</div>
|
171
|
+
<div class='source'>
|
172
|
+
<a class='source-toggle' href='#' onclick="toggleCode('M000088-source'); return false">
|
173
|
+
[show source]
|
174
|
+
</a>
|
175
|
+
<pre id='M000088-source'> <span class="ruby-comment cmt"># File lib/sdl4r/sdl_binary.rb, line 50</span>
50: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_s</span>
51: <span class="ruby-keyword kw">return</span> <span class="ruby-constant">Base64</span>.<span class="ruby-identifier">encode64</span>(<span class="ruby-identifier">bytes</span>)
52: <span class="ruby-keyword kw">end</span></pre>
|
176
|
+
</div>
|
177
|
+
</div>
|
178
|
+
</div>
|
261
179
|
</div>
|
262
180
|
</div>
|
263
181
|
</div>
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
<div class="method-heading">
|
269
|
-
<a href="#M000059" class="method-signature">
|
270
|
-
<span class="method-name">to_s</span><span class="method-args">()</span>
|
271
|
-
</a>
|
272
|
-
</div>
|
273
|
-
|
274
|
-
<div class="method-description">
|
275
|
-
<p>
|
276
|
-
Returns the bytes base64-encoded.
|
277
|
-
</p>
|
278
|
-
<p><a class="source-toggle" href="#"
|
279
|
-
onclick="toggleCode('M000059-source');return false;">[Source]</a></p>
|
280
|
-
<div class="method-source-code" id="M000059-source">
|
281
|
-
<pre>
|
282
|
-
<span class="ruby-comment cmt"># File lib/sdl4r/sdl_binary.rb, line 50</span>
|
283
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_s</span>
|
284
|
-
<span class="ruby-keyword kw">return</span> <span class="ruby-constant">Base64</span>.<span class="ruby-identifier">encode64</span>(<span class="ruby-identifier">bytes</span>)
|
285
|
-
<span class="ruby-keyword kw">end</span>
|
286
|
-
</pre>
|
287
|
-
</div>
|
288
|
-
</div>
|
289
|
-
</div>
|
290
|
-
|
291
|
-
|
182
|
+
<div id='footer-push'></div>
|
183
|
+
</div>
|
184
|
+
<div id='footer'>
|
185
|
+
<a href="http://github.com/mislav/hanna/tree/master"><strong>Hanna</strong> RDoc template</a>
|
292
186
|
</div>
|
293
|
-
|
294
|
-
|
295
|
-
</div>
|
296
|
-
|
297
|
-
|
298
|
-
<div id="validator-badges">
|
299
|
-
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
300
|
-
</div>
|
301
|
-
|
302
|
-
</body>
|
303
|
-
</html>
|
187
|
+
</body>
|
188
|
+
</html>
|