gnip_api 1.2.2 → 1.2.3
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.
- checksums.yaml +4 -4
- data/Gemfile.lock +24 -3
- data/README.md +70 -33
- data/Rakefile +7 -0
- data/doc/rdoc/classes/Gnip/Activity.html +354 -0
- data/doc/rdoc/classes/Gnip/Actor.html +300 -0
- data/doc/rdoc/classes/Gnip/GnipData.html +154 -0
- data/doc/rdoc/classes/Gnip/Message.html +236 -0
- data/doc/rdoc/classes/Gnip/SystemMessage.html +190 -0
- data/doc/rdoc/classes/Gnip/TwitterComplianceMessage.html +194 -0
- data/doc/rdoc/classes/Gnip/UndefinedMessage.html +83 -0
- data/doc/rdoc/classes/Gnip/Url.html +194 -0
- data/doc/rdoc/classes/Gnip.html +95 -0
- data/doc/rdoc/classes/GnipApi/Adapter.html +287 -0
- data/doc/rdoc/classes/GnipApi/Configuration.html +194 -0
- data/doc/rdoc/classes/GnipApi/Endpoints.html +191 -0
- data/doc/rdoc/classes/GnipApi/Errors/Adapter/GnipSoftwareError.html +83 -0
- data/doc/rdoc/classes/GnipApi/Errors/Adapter/RateLimitError.html +83 -0
- data/doc/rdoc/classes/GnipApi/Errors/Adapter/RequestError.html +56 -0
- data/doc/rdoc/classes/GnipApi/Errors/Adapter.html +66 -0
- data/doc/rdoc/classes/GnipApi/Errors/Configuration/InvalidOutputFormat.html +83 -0
- data/doc/rdoc/classes/GnipApi/Errors/Configuration.html +58 -0
- data/doc/rdoc/classes/GnipApi/Errors/JsonParser/ParseError.html +56 -0
- data/doc/rdoc/classes/GnipApi/Errors/JsonParser.html +64 -0
- data/doc/rdoc/classes/GnipApi/Errors/MissingAdapter.html +83 -0
- data/doc/rdoc/classes/GnipApi/Errors/MissingCredentials.html +83 -0
- data/doc/rdoc/classes/GnipApi/Errors/PowerTrack/MissingRules.html +83 -0
- data/doc/rdoc/classes/GnipApi/Errors/PowerTrack/StreamDown.html +56 -0
- data/doc/rdoc/classes/GnipApi/Errors/PowerTrack.html +65 -0
- data/doc/rdoc/classes/GnipApi/Errors/Search/MissingParameters.html +83 -0
- data/doc/rdoc/classes/GnipApi/Errors/Search.html +64 -0
- data/doc/rdoc/classes/GnipApi/Errors.html +79 -0
- data/doc/rdoc/classes/GnipApi/JsonParser.html +101 -0
- data/doc/rdoc/classes/GnipApi/PowerTrack/Buffer.html +237 -0
- data/doc/rdoc/classes/GnipApi/PowerTrack/Rule.html +196 -0
- data/doc/rdoc/classes/GnipApi/PowerTrack/Rules.html +188 -0
- data/doc/rdoc/classes/GnipApi/PowerTrack/Stream.html +359 -0
- data/doc/rdoc/classes/GnipApi/PowerTrack.html +73 -0
- data/doc/rdoc/classes/GnipApi/Request.html +216 -0
- data/doc/rdoc/classes/GnipApi/Response.html +232 -0
- data/doc/rdoc/classes/GnipApi/Search.html +101 -0
- data/doc/rdoc/classes/GnipApi.html +252 -0
- data/doc/rdoc/created.rid +24 -0
- data/doc/rdoc/css/style.css +343 -0
- data/doc/rdoc/files/LICENSE_txt.html +73 -0
- data/doc/rdoc/files/README_md.html +299 -0
- data/doc/rdoc/files/lib/gnip_api/adapter_rb.html +51 -0
- data/doc/rdoc/files/lib/gnip_api/configuration_rb.html +51 -0
- data/doc/rdoc/files/lib/gnip_api/endpoints_rb.html +51 -0
- data/doc/rdoc/files/lib/gnip_api/errors_rb.html +51 -0
- data/doc/rdoc/files/lib/gnip_api/gnip/activity_rb.html +51 -0
- data/doc/rdoc/files/lib/gnip_api/gnip/actor_rb.html +51 -0
- data/doc/rdoc/files/lib/gnip_api/gnip/gnip_data_rb.html +51 -0
- data/doc/rdoc/files/lib/gnip_api/gnip/message_rb.html +51 -0
- data/doc/rdoc/files/lib/gnip_api/gnip/system_message_rb.html +51 -0
- data/doc/rdoc/files/lib/gnip_api/gnip/twitter_compliance_message_rb.html +51 -0
- data/doc/rdoc/files/lib/gnip_api/gnip/url_rb.html +51 -0
- data/doc/rdoc/files/lib/gnip_api/json_parser_rb.html +51 -0
- data/doc/rdoc/files/lib/gnip_api/power_track/buffer_rb.html +51 -0
- data/doc/rdoc/files/lib/gnip_api/power_track/rule_rb.html +51 -0
- data/doc/rdoc/files/lib/gnip_api/power_track/rules_rb.html +55 -0
- data/doc/rdoc/files/lib/gnip_api/power_track/stream_rb.html +51 -0
- data/doc/rdoc/files/lib/gnip_api/request_rb.html +51 -0
- data/doc/rdoc/files/lib/gnip_api/response_rb.html +51 -0
- data/doc/rdoc/files/lib/gnip_api/search_rb.html +55 -0
- data/doc/rdoc/files/lib/gnip_api/version_rb.html +51 -0
- data/doc/rdoc/files/lib/gnip_api_rb.html +84 -0
- data/doc/rdoc/fr_class_index.html +92 -0
- data/doc/rdoc/fr_file_index.html +41 -0
- data/doc/rdoc/fr_method_index.html +4791 -0
- data/doc/rdoc/index.html +15 -0
- data/gnip_api.gemspec +3 -1
- data/lib/gnip_api/configuration.rb +18 -4
- data/lib/gnip_api/errors.rb +0 -1
- data/lib/gnip_api/power_track/buffer.rb +60 -14
- data/lib/gnip_api/power_track/stream.rb +52 -17
- data/lib/gnip_api/response.rb +3 -2
- data/lib/gnip_api/version.rb +1 -1
- data/spec/gnip_api/power_track/buffer_spec.rb +8 -0
- data/spec/gnip_api/response_spec.rb +16 -0
- data/spec/spec_helper.rb +1 -0
- metadata +97 -2
@@ -0,0 +1,79 @@
|
|
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>GnipApi::Errors</title>
|
5
|
+
<meta content='text/html; charset=UTF-8' http-equiv='Content-Type'>
|
6
|
+
<link href='../../css/style.css' media='screen' rel='stylesheet' type='text/css'>
|
7
|
+
<script type='text/javascript'>
|
8
|
+
function popupCode(url) {
|
9
|
+
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
10
|
+
}
|
11
|
+
|
12
|
+
function toggleCode(id) {
|
13
|
+
var code = document.getElementById(id)
|
14
|
+
|
15
|
+
code.style.display = code.style.display != 'block' ? 'block' : 'none'
|
16
|
+
return true
|
17
|
+
}
|
18
|
+
|
19
|
+
// Make codeblocks hidden by default
|
20
|
+
document.writeln('<' + 'style type="text/css">.method .source pre { display: none }<\/style>')
|
21
|
+
</script>
|
22
|
+
</head>
|
23
|
+
<body class='page'>
|
24
|
+
<div class='class' id='wrapper'>
|
25
|
+
<div class='header'>
|
26
|
+
<h1 class='name'><span class='type'>module</span>
|
27
|
+
GnipApi::Errors
|
28
|
+
</h1>
|
29
|
+
<ol class='paths'>
|
30
|
+
<li>
|
31
|
+
<a href="../../files/lib/gnip_api/errors_rb.html">lib/gnip_api/errors.rb</a>
|
32
|
+
</li>
|
33
|
+
<li class='other'>
|
34
|
+
<a href="../../files/lib/gnip_api/json_parser_rb.html">lib/gnip_api/json_parser.rb</a>
|
35
|
+
</li>
|
36
|
+
<li class='other'>
|
37
|
+
<a href="../../files/lib/gnip_api/power_track/stream_rb.html">lib/gnip_api/power_track/stream.rb</a>
|
38
|
+
</li>
|
39
|
+
<li class='other'>
|
40
|
+
<a href="../../files/lib/gnip_api/response_rb.html">lib/gnip_api/response.rb</a>
|
41
|
+
</li>
|
42
|
+
<li class='other'>
|
43
|
+
<a href="../../files/lib/gnip_api/search_rb.html">lib/gnip_api/search.rb</a>
|
44
|
+
</li>
|
45
|
+
<li>
|
46
|
+
<a class='show' href='#' onclick='this.parentNode.parentNode.className += " expanded"; this.parentNode.removeChild(this); return false'>show all</a>
|
47
|
+
</li>
|
48
|
+
</ol>
|
49
|
+
</div>
|
50
|
+
<div id='content'>
|
51
|
+
<div id='text'>
|
52
|
+
<div id='description'></div>
|
53
|
+
<div id='context'>
|
54
|
+
</div>
|
55
|
+
<div id='class-list'>
|
56
|
+
<h2>Classes and Modules</h2>
|
57
|
+
<ol>
|
58
|
+
<li><a href="Errors/Adapter.html">GnipApi::Errors::Adapter</a></li>
|
59
|
+
<li><a href="Errors/Configuration.html">GnipApi::Errors::Configuration</a></li>
|
60
|
+
<li><a href="Errors/JsonParser.html">GnipApi::Errors::JsonParser</a></li>
|
61
|
+
<li><a href="Errors/PowerTrack.html">GnipApi::Errors::PowerTrack</a></li>
|
62
|
+
<li><a href="Errors/Search.html">GnipApi::Errors::Search</a></li>
|
63
|
+
<li><a href="Errors/MissingAdapter.html">GnipApi::Errors::MissingAdapter</a></li>
|
64
|
+
<li><a href="Errors/MissingCredentials.html">GnipApi::Errors::MissingCredentials</a></li>
|
65
|
+
</ol>
|
66
|
+
</div>
|
67
|
+
<div id='section'>
|
68
|
+
</div>
|
69
|
+
|
70
|
+
</div>
|
71
|
+
</div>
|
72
|
+
|
73
|
+
<div id='footer-push'></div>
|
74
|
+
</div>
|
75
|
+
<div id='footer'>
|
76
|
+
<a href="https://github.com/rdoc/hanna-nouveau"><strong>Hanna Nouveau</strong> RDoc template</a>
|
77
|
+
</div>
|
78
|
+
</body>
|
79
|
+
</html>
|
@@ -0,0 +1,101 @@
|
|
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>GnipApi::JsonParser</title>
|
5
|
+
<meta content='text/html; charset=UTF-8' http-equiv='Content-Type'>
|
6
|
+
<link href='../../css/style.css' media='screen' rel='stylesheet' type='text/css'>
|
7
|
+
<script type='text/javascript'>
|
8
|
+
function popupCode(url) {
|
9
|
+
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
10
|
+
}
|
11
|
+
|
12
|
+
function toggleCode(id) {
|
13
|
+
var code = document.getElementById(id)
|
14
|
+
|
15
|
+
code.style.display = code.style.display != 'block' ? 'block' : 'none'
|
16
|
+
return true
|
17
|
+
}
|
18
|
+
|
19
|
+
// Make codeblocks hidden by default
|
20
|
+
document.writeln('<' + 'style type="text/css">.method .source pre { display: none }<\/style>')
|
21
|
+
</script>
|
22
|
+
</head>
|
23
|
+
<body class='page'>
|
24
|
+
<div class='class' id='wrapper'>
|
25
|
+
<div class='header'>
|
26
|
+
<h1 class='name'><span class='type'>class</span>
|
27
|
+
GnipApi::JsonParser
|
28
|
+
</h1>
|
29
|
+
<ol class='paths'>
|
30
|
+
<li>
|
31
|
+
<a href="../../files/lib/gnip_api/json_parser_rb.html">lib/gnip_api/json_parser.rb</a>
|
32
|
+
</li>
|
33
|
+
</ol>
|
34
|
+
<div class='parent'>
|
35
|
+
Superclass:
|
36
|
+
<strong>Object</strong>
|
37
|
+
</div>
|
38
|
+
</div>
|
39
|
+
<div id='content'>
|
40
|
+
<div id='text'>
|
41
|
+
<div id='description'></div>
|
42
|
+
<div id='method-list'>
|
43
|
+
<h2>Methods</h2>
|
44
|
+
<h3>Public Instance</h3>
|
45
|
+
<ol>
|
46
|
+
<li><a href="#method-i-encode">encode</a></li>
|
47
|
+
<li><a href="#method-i-parse">parse</a></li>
|
48
|
+
</ol>
|
49
|
+
</div>
|
50
|
+
<div id='context'>
|
51
|
+
</div>
|
52
|
+
<div id='section'>
|
53
|
+
<div id='methods'>
|
54
|
+
<h2>Public Instance methods</h2>
|
55
|
+
<div class='method public-instance' id='method-method-i-encode'>
|
56
|
+
<a name='method-i-encode'></a>
|
57
|
+
<div class='synopsis'>
|
58
|
+
<span class='name'>encode</span>
|
59
|
+
<span class='arguments'>(data)</span>
|
60
|
+
|
61
|
+
</div>
|
62
|
+
<div class='description'>
|
63
|
+
|
64
|
+
</div>
|
65
|
+
<div class='source'>
|
66
|
+
<a class='source-toggle' href='#' onclick='toggleCode('method-i-encode-source'); return false'>
|
67
|
+
[show source]
|
68
|
+
</a>
|
69
|
+
<pre id='method-i-encode-source'><span class="ruby-comment"># File lib/gnip_api/json_parser.rb, line 11</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">encode</span> <span class="ruby-identifier">data</span>
 <span class="ruby-keyword">return</span> <span class="ruby-identifier">encoder</span>.<span class="ruby-identifier">encode</span>(<span class="ruby-identifier">data</span>)
<span class="ruby-keyword">end</span></pre>
|
70
|
+
</div>
|
71
|
+
</div>
|
72
|
+
<div class='method public-instance' id='method-method-i-parse'>
|
73
|
+
<a name='method-i-parse'></a>
|
74
|
+
<div class='synopsis'>
|
75
|
+
<span class='name'>parse</span>
|
76
|
+
<span class='arguments'>(data)</span>
|
77
|
+
|
78
|
+
</div>
|
79
|
+
<div class='description'>
|
80
|
+
|
81
|
+
</div>
|
82
|
+
<div class='source'>
|
83
|
+
<a class='source-toggle' href='#' onclick='toggleCode('method-i-parse-source'); return false'>
|
84
|
+
[show source]
|
85
|
+
</a>
|
86
|
+
<pre id='method-i-parse-source'><span class="ruby-comment"># File lib/gnip_api/json_parser.rb, line 3</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">parse</span> <span class="ruby-identifier">data</span>
 <span class="ruby-keyword">begin</span>
 <span class="ruby-keyword">return</span> <span class="ruby-identifier">parser</span>.<span class="ruby-identifier">parse</span>(<span class="ruby-identifier">data</span>)
 <span class="ruby-keyword">rescue</span> <span class="ruby-constant">Yajl</span><span class="ruby-operator">::</span><span class="ruby-constant">ParseError</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">error</span>
 <span class="ruby-identifier">raise</span> <span class="ruby-constant">GnipApi</span><span class="ruby-operator">::</span><span class="ruby-constant">Errors</span><span class="ruby-operator">::</span><span class="ruby-constant">JsonParser</span><span class="ruby-operator">::</span><span class="ruby-constant">ParseError</span>.<span class="ruby-identifier">new</span>(<span class="ruby-node">"Yajl failed to parse: #{error.class} -- #{error.message}"</span>)
 <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
|
87
|
+
</div>
|
88
|
+
</div>
|
89
|
+
</div>
|
90
|
+
</div>
|
91
|
+
|
92
|
+
</div>
|
93
|
+
</div>
|
94
|
+
|
95
|
+
<div id='footer-push'></div>
|
96
|
+
</div>
|
97
|
+
<div id='footer'>
|
98
|
+
<a href="https://github.com/rdoc/hanna-nouveau"><strong>Hanna Nouveau</strong> RDoc template</a>
|
99
|
+
</div>
|
100
|
+
</body>
|
101
|
+
</html>
|
@@ -0,0 +1,237 @@
|
|
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>GnipApi::PowerTrack::Buffer</title>
|
5
|
+
<meta content='text/html; charset=UTF-8' http-equiv='Content-Type'>
|
6
|
+
<link href='../../../css/style.css' media='screen' rel='stylesheet' type='text/css'>
|
7
|
+
<script type='text/javascript'>
|
8
|
+
function popupCode(url) {
|
9
|
+
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
10
|
+
}
|
11
|
+
|
12
|
+
function toggleCode(id) {
|
13
|
+
var code = document.getElementById(id)
|
14
|
+
|
15
|
+
code.style.display = code.style.display != 'block' ? 'block' : 'none'
|
16
|
+
return true
|
17
|
+
}
|
18
|
+
|
19
|
+
// Make codeblocks hidden by default
|
20
|
+
document.writeln('<' + 'style type="text/css">.method .source pre { display: none }<\/style>')
|
21
|
+
</script>
|
22
|
+
</head>
|
23
|
+
<body class='page'>
|
24
|
+
<div class='class' id='wrapper'>
|
25
|
+
<div class='header'>
|
26
|
+
<h1 class='name'><span class='type'>class</span>
|
27
|
+
GnipApi::PowerTrack::Buffer
|
28
|
+
</h1>
|
29
|
+
<ol class='paths'>
|
30
|
+
<li>
|
31
|
+
<a href="../../../files/lib/gnip_api/power_track/buffer_rb.html">lib/gnip_api/power_track/buffer.rb</a>
|
32
|
+
</li>
|
33
|
+
</ol>
|
34
|
+
<div class='parent'>
|
35
|
+
Superclass:
|
36
|
+
<strong>Object</strong>
|
37
|
+
</div>
|
38
|
+
</div>
|
39
|
+
<div id='content'>
|
40
|
+
<div id='text'>
|
41
|
+
<div id='description'>
|
42
|
+
<p>Collects raw data from the stream received in chunks and splits it using
|
43
|
+
the '\r\n' character to return complete items in JSON format.</p>
|
44
|
+
</div>
|
45
|
+
<div id='method-list'>
|
46
|
+
<h2>Methods</h2>
|
47
|
+
<h3>Public Class</h3>
|
48
|
+
<ol>
|
49
|
+
<li><a href="#method-c-new">new</a></li>
|
50
|
+
</ol>
|
51
|
+
<h3>Public Instance</h3>
|
52
|
+
<ol>
|
53
|
+
<li><a href="#method-i-consume-21">consume!</a></li>
|
54
|
+
<li><a href="#attribute-i-data">data</a></li>
|
55
|
+
<li><a href="#method-i-insert-21">insert!</a></li>
|
56
|
+
<li><a href="#attribute-i-logger">logger</a></li>
|
57
|
+
<li><a href="#method-i-read-21">read!</a></li>
|
58
|
+
<li><a href="#method-i-size">size</a></li>
|
59
|
+
<li><a href="#attribute-i-terminator">terminator</a></li>
|
60
|
+
</ol>
|
61
|
+
</div>
|
62
|
+
<div id='context'>
|
63
|
+
</div>
|
64
|
+
<div id='section'>
|
65
|
+
<div id='attribute-list'>
|
66
|
+
<h2 class='section-bar'>Attributes</h2>
|
67
|
+
<div class='name-list'>
|
68
|
+
<table>
|
69
|
+
<tr class='top-aligned-row context-row'>
|
70
|
+
<td class='context-item-name'>
|
71
|
+
<a name='attribute-i-data'>data</a>
|
72
|
+
</td>
|
73
|
+
<td class='context-item-value'>[R]</td>
|
74
|
+
<td class='context-item-desc'></td>
|
75
|
+
</tr>
|
76
|
+
<tr class='top-aligned-row context-row'>
|
77
|
+
<td class='context-item-name'>
|
78
|
+
<a name='attribute-i-logger'>logger</a>
|
79
|
+
</td>
|
80
|
+
<td class='context-item-value'>[R]</td>
|
81
|
+
<td class='context-item-desc'></td>
|
82
|
+
</tr>
|
83
|
+
<tr class='top-aligned-row context-row'>
|
84
|
+
<td class='context-item-name'>
|
85
|
+
<a name='attribute-i-terminator'>terminator</a>
|
86
|
+
</td>
|
87
|
+
<td class='context-item-value'>[R]</td>
|
88
|
+
<td class='context-item-desc'></td>
|
89
|
+
</tr>
|
90
|
+
</table>
|
91
|
+
</div>
|
92
|
+
</div>
|
93
|
+
<div id='methods'>
|
94
|
+
<h2>Public Class methods</h2>
|
95
|
+
<div class='method public-class' id='method-method-c-new'>
|
96
|
+
<a name='method-c-new'></a>
|
97
|
+
<div class='synopsis'>
|
98
|
+
<span class='name'>new</span>
|
99
|
+
<span class='arguments'>(options={})</span>
|
100
|
+
|
101
|
+
</div>
|
102
|
+
<div class='description'>
|
103
|
+
|
104
|
+
</div>
|
105
|
+
<div class='source'>
|
106
|
+
<a class='source-toggle' href='#' onclick='toggleCode('method-c-new-source'); return false'>
|
107
|
+
[show source]
|
108
|
+
</a>
|
109
|
+
<pre id='method-c-new-source'><span class="ruby-comment"># File lib/gnip_api/power_track/buffer.rb, line 9</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">initialize</span> <span class="ruby-identifier">options</span>={}
 <span class="ruby-ivar">@terminator</span> = <span class="ruby-identifier">options</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-value">:terminator</span>) <span class="ruby-operator">||</span> <span class="ruby-string">"\r\n"</span>
 <span class="ruby-ivar">@data</span> = <span class="ruby-string">""</span>
 <span class="ruby-ivar">@logger</span> = <span class="ruby-constant">GnipApi</span>.<span class="ruby-identifier">logger</span>
 <span class="ruby-ivar">@check_span</span> = <span class="ruby-value">30</span>
 <span class="ruby-ivar">@last_check</span> = <span class="ruby-constant">Time</span>.<span class="ruby-identifier">now</span>
<span class="ruby-keyword">end</span></pre>
|
110
|
+
</div>
|
111
|
+
</div>
|
112
|
+
<h2>Public Instance methods</h2>
|
113
|
+
<div class='method public-instance' id='method-method-i-consume-21'>
|
114
|
+
<a name='method-i-consume-21'></a>
|
115
|
+
<div class='synopsis'>
|
116
|
+
<span class='name'>consume!</span>
|
117
|
+
<span class='arguments'>(char_count)</span>
|
118
|
+
|
119
|
+
</div>
|
120
|
+
<div class='description'>
|
121
|
+
|
122
|
+
<p>Reads <code>char_count</code> characters from <code>data</code> removing
|
123
|
+
them, and returns the extracted characters.</p>
|
124
|
+
|
125
|
+
</div>
|
126
|
+
<div class='source'>
|
127
|
+
<a class='source-toggle' href='#' onclick='toggleCode('method-i-consume-21-source'); return false'>
|
128
|
+
[show source]
|
129
|
+
</a>
|
130
|
+
<pre id='method-i-consume-21-source'><span class="ruby-comment"># File lib/gnip_api/power_track/buffer.rb, line 72</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">consume!</span> <span class="ruby-identifier">char_count</span>
 <span class="ruby-ivar">@data</span>.<span class="ruby-identifier">slice!</span>(<span class="ruby-value">0</span>, <span class="ruby-identifier">char_count</span>)
<span class="ruby-keyword">end</span></pre>
|
131
|
+
</div>
|
132
|
+
</div>
|
133
|
+
<div class='method public-instance' id='method-method-i-insert-21'>
|
134
|
+
<a name='method-i-insert-21'></a>
|
135
|
+
<div class='synopsis'>
|
136
|
+
<span class='name'>insert!</span>
|
137
|
+
<span class='arguments'>(chunk)</span>
|
138
|
+
|
139
|
+
</div>
|
140
|
+
<div class='description'>
|
141
|
+
|
142
|
+
<p>Inserts a <code>chunk</code> into the buffer.</p>
|
143
|
+
|
144
|
+
</div>
|
145
|
+
<div class='source'>
|
146
|
+
<a class='source-toggle' href='#' onclick='toggleCode('method-i-insert-21-source'); return false'>
|
147
|
+
[show source]
|
148
|
+
</a>
|
149
|
+
<pre id='method-i-insert-21-source'><span class="ruby-comment"># File lib/gnip_api/power_track/buffer.rb, line 23</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">insert!</span> <span class="ruby-identifier">chunk</span>
 <span class="ruby-identifier">check</span>
 <span class="ruby-ivar">@data</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">chunk</span>
<span class="ruby-keyword">end</span></pre>
|
150
|
+
</div>
|
151
|
+
</div>
|
152
|
+
<div class='method public-instance' id='method-method-i-read-21'>
|
153
|
+
<a name='method-i-read-21'></a>
|
154
|
+
<div class='synopsis'>
|
155
|
+
<span class='name'>read!</span>
|
156
|
+
<span class='arguments'>()</span>
|
157
|
+
|
158
|
+
</div>
|
159
|
+
<div class='description'>
|
160
|
+
|
161
|
+
<p>Splits the data and gets completed items from the buffer to remove them
|
162
|
+
from the buffer and return them as an Array of items.</p>
|
163
|
+
|
164
|
+
<p><code>data</code> is a simple String object that gets stuff added and using
|
165
|
+
<a href="Buffer.html#method-i-read-21">read!</a> gets stuff removed. At any
|
166
|
+
moment <code>data</code> can contain:</p>
|
167
|
+
<ul><li>
|
168
|
+
<p>a fragment of an item</p>
|
169
|
+
</li><li>
|
170
|
+
<p>a complete item and a fragment of another</p>
|
171
|
+
</li><li>
|
172
|
+
<p>one or more complete items</p>
|
173
|
+
</li><li>
|
174
|
+
<p>a complete item followed by various terminator chars</p>
|
175
|
+
</li></ul>
|
176
|
+
|
177
|
+
<p>In all cases <a href="Buffer.html#method-i-read-21">read!</a> will return
|
178
|
+
complete items only, removing these from <code>data</code> as it reads it.
|
179
|
+
The way it does this is by finding the last terminator from right to left.
|
180
|
+
String#rindex method will return the index (starting at 0) of the first
|
181
|
+
char of the terminator. To properly read the data, a +1 is added to this
|
182
|
+
index. Then another +1 is added to make it a count for <a
|
183
|
+
href="Buffer.html#method-i-consume-21">consume!</a> to read. Note that <a
|
184
|
+
href="Buffer.html#method-i-consume-21">consume!</a> eats up an amount of
|
185
|
+
characters from left to right. The cut piece from the buffer is then
|
186
|
+
splitted by the terminator to return the completed items. In the cut piece
|
187
|
+
a terminator at the end will always be present, but the Array#split method
|
188
|
+
already ignores that final one.</p>
|
189
|
+
|
190
|
+
<p>If there's a single incomplete fragment in <code>data</code>, the index
|
191
|
+
lookup will return <code>nil</code> and an empty list will be returned,
|
192
|
+
signaling nothing to read in the buffer and doing nothing to it until more
|
193
|
+
chunks are inserted.</p>
|
194
|
+
|
195
|
+
<p>In the case many terminator chars end up in the buffer, after split these
|
196
|
+
will render as empty strings and removed from the list of items to return.</p>
|
197
|
+
|
198
|
+
</div>
|
199
|
+
<div class='source'>
|
200
|
+
<a class='source-toggle' href='#' onclick='toggleCode('method-i-read-21-source'); return false'>
|
201
|
+
[show source]
|
202
|
+
</a>
|
203
|
+
<pre id='method-i-read-21-source'><span class="ruby-comment"># File lib/gnip_api/power_track/buffer.rb, line 59</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">read!</span>
 <span class="ruby-identifier">objects</span> = []
 <span class="ruby-identifier">last_terminator_index</span> = <span class="ruby-ivar">@data</span>.<span class="ruby-identifier">rindex</span>(<span class="ruby-identifier">terminator</span>)
 <span class="ruby-keyword">if</span> <span class="ruby-identifier">last_terminator_index</span>
 <span class="ruby-identifier">last_terminator_index</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span> <span class="ruby-comment"># include the following \n</span>
 <span class="ruby-identifier">objects</span> = <span class="ruby-identifier">consume!</span>(<span class="ruby-identifier">last_terminator_index</span> <span class="ruby-operator">+</span> <span class="ruby-value">1</span>) <span class="ruby-comment"># extract upto las terminator positin, +1 because it's an index</span>
 <span class="ruby-identifier">objects</span> = <span class="ruby-identifier">objects</span>.<span class="ruby-identifier">split</span>(<span class="ruby-identifier">terminator</span>).<span class="ruby-identifier">delete_if</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">item</span><span class="ruby-operator">|</span> <span class="ruby-identifier">item</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">item</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">==</span> <span class="ruby-value">0</span>}
 <span class="ruby-keyword">end</span>
 <span class="ruby-keyword">return</span> <span class="ruby-identifier">objects</span>
<span class="ruby-keyword">end</span></pre>
|
204
|
+
</div>
|
205
|
+
</div>
|
206
|
+
<div class='method public-instance' id='method-method-i-size'>
|
207
|
+
<a name='method-i-size'></a>
|
208
|
+
<div class='synopsis'>
|
209
|
+
<span class='name'>size</span>
|
210
|
+
<span class='arguments'>()</span>
|
211
|
+
|
212
|
+
</div>
|
213
|
+
<div class='description'>
|
214
|
+
|
215
|
+
<p>Returns the current size of the buffer.</p>
|
216
|
+
|
217
|
+
</div>
|
218
|
+
<div class='source'>
|
219
|
+
<a class='source-toggle' href='#' onclick='toggleCode('method-i-size-source'); return false'>
|
220
|
+
[show source]
|
221
|
+
</a>
|
222
|
+
<pre id='method-i-size-source'><span class="ruby-comment"># File lib/gnip_api/power_track/buffer.rb, line 18</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">size</span>
 <span class="ruby-ivar">@data</span>.<span class="ruby-identifier">size</span>
<span class="ruby-keyword">end</span></pre>
|
223
|
+
</div>
|
224
|
+
</div>
|
225
|
+
</div>
|
226
|
+
</div>
|
227
|
+
|
228
|
+
</div>
|
229
|
+
</div>
|
230
|
+
|
231
|
+
<div id='footer-push'></div>
|
232
|
+
</div>
|
233
|
+
<div id='footer'>
|
234
|
+
<a href="https://github.com/rdoc/hanna-nouveau"><strong>Hanna Nouveau</strong> RDoc template</a>
|
235
|
+
</div>
|
236
|
+
</body>
|
237
|
+
</html>
|
@@ -0,0 +1,196 @@
|
|
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>GnipApi::PowerTrack::Rule</title>
|
5
|
+
<meta content='text/html; charset=UTF-8' http-equiv='Content-Type'>
|
6
|
+
<link href='../../../css/style.css' media='screen' rel='stylesheet' type='text/css'>
|
7
|
+
<script type='text/javascript'>
|
8
|
+
function popupCode(url) {
|
9
|
+
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
10
|
+
}
|
11
|
+
|
12
|
+
function toggleCode(id) {
|
13
|
+
var code = document.getElementById(id)
|
14
|
+
|
15
|
+
code.style.display = code.style.display != 'block' ? 'block' : 'none'
|
16
|
+
return true
|
17
|
+
}
|
18
|
+
|
19
|
+
// Make codeblocks hidden by default
|
20
|
+
document.writeln('<' + 'style type="text/css">.method .source pre { display: none }<\/style>')
|
21
|
+
</script>
|
22
|
+
</head>
|
23
|
+
<body class='page'>
|
24
|
+
<div class='class' id='wrapper'>
|
25
|
+
<div class='header'>
|
26
|
+
<h1 class='name'><span class='type'>class</span>
|
27
|
+
GnipApi::PowerTrack::Rule
|
28
|
+
</h1>
|
29
|
+
<ol class='paths'>
|
30
|
+
<li>
|
31
|
+
<a href="../../../files/lib/gnip_api/power_track/rule_rb.html">lib/gnip_api/power_track/rule.rb</a>
|
32
|
+
</li>
|
33
|
+
</ol>
|
34
|
+
<div class='parent'>
|
35
|
+
Superclass:
|
36
|
+
<strong>Object</strong>
|
37
|
+
</div>
|
38
|
+
</div>
|
39
|
+
<div id='content'>
|
40
|
+
<div id='text'>
|
41
|
+
<div id='description'>
|
42
|
+
<p>Represents a <a href="../PowerTrack.html">PowerTrack</a> rule with its
|
43
|
+
necesary attribures.</p>
|
44
|
+
</div>
|
45
|
+
<div id='method-list'>
|
46
|
+
<h2>Methods</h2>
|
47
|
+
<h3>Public Class</h3>
|
48
|
+
<ol>
|
49
|
+
<li><a href="#method-c-new">new</a></li>
|
50
|
+
</ol>
|
51
|
+
<h3>Public Instance</h3>
|
52
|
+
<ol>
|
53
|
+
<li><a href="#method-i-attributes">attributes</a></li>
|
54
|
+
<li><a href="#method-i-consistent-3F">consistent?</a></li>
|
55
|
+
<li><a href="#attribute-i-id">id</a></li>
|
56
|
+
<li><a href="#attribute-i-tag">tag</a></li>
|
57
|
+
<li><a href="#method-i-to_json">to_json</a></li>
|
58
|
+
<li><a href="#method-i-uid">uid</a></li>
|
59
|
+
<li><a href="#attribute-i-value">value</a></li>
|
60
|
+
</ol>
|
61
|
+
</div>
|
62
|
+
<div id='context'>
|
63
|
+
</div>
|
64
|
+
<div id='section'>
|
65
|
+
<div id='attribute-list'>
|
66
|
+
<h2 class='section-bar'>Attributes</h2>
|
67
|
+
<div class='name-list'>
|
68
|
+
<table>
|
69
|
+
<tr class='top-aligned-row context-row'>
|
70
|
+
<td class='context-item-name'>
|
71
|
+
<a name='attribute-i-id'>id</a>
|
72
|
+
</td>
|
73
|
+
<td class='context-item-value'>[RW]</td>
|
74
|
+
<td class='context-item-desc'></td>
|
75
|
+
</tr>
|
76
|
+
<tr class='top-aligned-row context-row'>
|
77
|
+
<td class='context-item-name'>
|
78
|
+
<a name='attribute-i-tag'>tag</a>
|
79
|
+
</td>
|
80
|
+
<td class='context-item-value'>[RW]</td>
|
81
|
+
<td class='context-item-desc'></td>
|
82
|
+
</tr>
|
83
|
+
<tr class='top-aligned-row context-row'>
|
84
|
+
<td class='context-item-name'>
|
85
|
+
<a name='attribute-i-value'>value</a>
|
86
|
+
</td>
|
87
|
+
<td class='context-item-value'>[RW]</td>
|
88
|
+
<td class='context-item-desc'></td>
|
89
|
+
</tr>
|
90
|
+
</table>
|
91
|
+
</div>
|
92
|
+
</div>
|
93
|
+
<div id='methods'>
|
94
|
+
<h2>Public Class methods</h2>
|
95
|
+
<div class='method public-class' id='method-method-c-new'>
|
96
|
+
<a name='method-c-new'></a>
|
97
|
+
<div class='synopsis'>
|
98
|
+
<span class='name'>new</span>
|
99
|
+
<span class='arguments'>(params={})</span>
|
100
|
+
|
101
|
+
</div>
|
102
|
+
<div class='description'>
|
103
|
+
|
104
|
+
</div>
|
105
|
+
<div class='source'>
|
106
|
+
<a class='source-toggle' href='#' onclick='toggleCode('method-c-new-source'); return false'>
|
107
|
+
[show source]
|
108
|
+
</a>
|
109
|
+
<pre id='method-c-new-source'><span class="ruby-comment"># File lib/gnip_api/power_track/rule.rb, line 7</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">initialize</span> <span class="ruby-identifier">params</span>={}
 <span class="ruby-ivar">@value</span> = <span class="ruby-identifier">params</span>[<span class="ruby-value">:value</span>] <span class="ruby-operator">||</span> <span class="ruby-identifier">params</span>[<span class="ruby-string">'value'</span>]
 <span class="ruby-ivar">@tag</span> = <span class="ruby-identifier">params</span>[<span class="ruby-value">:tag</span>] <span class="ruby-operator">||</span> <span class="ruby-identifier">params</span>[<span class="ruby-string">'tag'</span>]
 <span class="ruby-ivar">@id</span> = <span class="ruby-identifier">params</span>[<span class="ruby-value">:id</span>] <span class="ruby-operator">||</span> <span class="ruby-identifier">params</span>[<span class="ruby-string">'id'</span>]
<span class="ruby-keyword">end</span></pre>
|
110
|
+
</div>
|
111
|
+
</div>
|
112
|
+
<h2>Public Instance methods</h2>
|
113
|
+
<div class='method public-instance' id='method-method-i-attributes'>
|
114
|
+
<a name='method-i-attributes'></a>
|
115
|
+
<div class='synopsis'>
|
116
|
+
<span class='name'>attributes</span>
|
117
|
+
<span class='arguments'>()</span>
|
118
|
+
|
119
|
+
</div>
|
120
|
+
<div class='description'>
|
121
|
+
|
122
|
+
</div>
|
123
|
+
<div class='source'>
|
124
|
+
<a class='source-toggle' href='#' onclick='toggleCode('method-i-attributes-source'); return false'>
|
125
|
+
[show source]
|
126
|
+
</a>
|
127
|
+
<pre id='method-i-attributes-source'><span class="ruby-comment"># File lib/gnip_api/power_track/rule.rb, line 17</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">attributes</span>
 <span class="ruby-identifier">attrs</span> = {}
 <span class="ruby-identifier">attrs</span>[<span class="ruby-value">:value</span>] = <span class="ruby-ivar">@value</span> <span class="ruby-keyword">if</span> <span class="ruby-ivar">@value</span>
 <span class="ruby-identifier">attrs</span>[<span class="ruby-value">:tag</span>] = <span class="ruby-ivar">@tag</span> <span class="ruby-keyword">if</span> <span class="ruby-ivar">@tag</span>
 <span class="ruby-identifier">attrs</span>[<span class="ruby-value">:id</span>] = <span class="ruby-ivar">@id</span> <span class="ruby-keyword">if</span> <span class="ruby-ivar">@id</span>
 <span class="ruby-identifier">attrs</span>
<span class="ruby-keyword">end</span></pre>
|
128
|
+
</div>
|
129
|
+
</div>
|
130
|
+
<div class='method public-instance' id='method-method-i-consistent-3F'>
|
131
|
+
<a name='method-i-consistent-3F'></a>
|
132
|
+
<div class='synopsis'>
|
133
|
+
<span class='name'>consistent?</span>
|
134
|
+
<span class='arguments'>(raise_error=false)</span>
|
135
|
+
|
136
|
+
</div>
|
137
|
+
<div class='description'>
|
138
|
+
|
139
|
+
<p>Simply checks balance of quotes and parenthesis within the value. Quoted
|
140
|
+
text is sort of escaped as long as it's consistently quoted.</p>
|
141
|
+
|
142
|
+
</div>
|
143
|
+
<div class='source'>
|
144
|
+
<a class='source-toggle' href='#' onclick='toggleCode('method-i-consistent-3F-source'); return false'>
|
145
|
+
[show source]
|
146
|
+
</a>
|
147
|
+
<pre id='method-i-consistent-3F-source'><span class="ruby-comment"># File lib/gnip_api/power_track/rule.rb, line 33</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">consistent?</span> <span class="ruby-identifier">raise_error</span>=<span class="ruby-keyword">false</span>
 <span class="ruby-identifier">characters</span> = <span class="ruby-identifier">value</span>.<span class="ruby-identifier">chars</span>
 <span class="ruby-identifier">parenthesis</span> = <span class="ruby-value">0</span>
 <span class="ruby-identifier">in_double_quotes</span> = <span class="ruby-keyword">false</span>
 <span class="ruby-identifier">in_single_quotes</span> = <span class="ruby-keyword">false</span>
 <span class="ruby-identifier">char</span> = <span class="ruby-identifier">characters</span>.<span class="ruby-identifier">shift</span>
 <span class="ruby-keyword">while</span> <span class="ruby-identifier">char</span>
 <span class="ruby-identifier">parenthesis</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span> <span class="ruby-keyword">if</span> (<span class="ruby-identifier">char</span> <span class="ruby-operator">==</span> <span class="ruby-string">'('</span>)
 <span class="ruby-identifier">parenthesis</span> <span class="ruby-operator">-=</span> <span class="ruby-value">1</span> <span class="ruby-keyword">if</span> (<span class="ruby-identifier">char</span> <span class="ruby-operator">==</span> <span class="ruby-string">')'</span>)

 <span class="ruby-keyword">if</span> <span class="ruby-identifier">char</span> <span class="ruby-operator">==</span> <span class="ruby-string">'"'</span>
 <span class="ruby-identifier">in_double_quotes</span> = <span class="ruby-keyword">true</span>
 <span class="ruby-identifier">char</span> = <span class="ruby-identifier">characters</span>.<span class="ruby-identifier">shift</span>
 <span class="ruby-keyword">while</span> <span class="ruby-identifier">char</span> <span class="ruby-operator">!=</span> <span class="ruby-string">'"'</span>
 <span class="ruby-identifier">char</span> = <span class="ruby-identifier">characters</span>.<span class="ruby-identifier">shift</span>
 <span class="ruby-keyword">break</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">char</span>.<span class="ruby-identifier">nil?</span>
 <span class="ruby-keyword">end</span>
 <span class="ruby-identifier">in_double_quotes</span> = <span class="ruby-keyword">false</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">char</span> <span class="ruby-operator">==</span> <span class="ruby-string">'"'</span>
 <span class="ruby-keyword">end</span>

 <span class="ruby-keyword">if</span> <span class="ruby-identifier">char</span> <span class="ruby-operator">==</span> <span class="ruby-string">"'"</span>
 <span class="ruby-identifier">in_single_quotes</span> = <span class="ruby-keyword">true</span>
 <span class="ruby-identifier">char</span> = <span class="ruby-identifier">characters</span>.<span class="ruby-identifier">shift</span>
 <span class="ruby-keyword">while</span> <span class="ruby-identifier">char</span> <span class="ruby-operator">!=</span> <span class="ruby-string">"'"</span>
 <span class="ruby-identifier">char</span> = <span class="ruby-identifier">characters</span>.<span class="ruby-identifier">shift</span>
 <span class="ruby-keyword">break</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">char</span>.<span class="ruby-identifier">nil?</span>
 <span class="ruby-keyword">end</span>
 <span class="ruby-identifier">in_single_quotes</span> = <span class="ruby-keyword">false</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">char</span> <span class="ruby-operator">==</span> <span class="ruby-string">"'"</span>
 <span class="ruby-keyword">end</span>

 <span class="ruby-identifier">char</span> = <span class="ruby-identifier">characters</span>.<span class="ruby-identifier">shift</span>
 <span class="ruby-keyword">end</span>

 <span class="ruby-keyword">if</span> <span class="ruby-identifier">raise_error</span>
 <span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>.<span class="ruby-identifier">new</span>(<span class="ruby-string">"Imbalanced parenthesis"</span>) <span class="ruby-keyword">if</span> <span class="ruby-identifier">parenthesis</span> <span class="ruby-operator">!=</span> <span class="ruby-value">0</span>
 <span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>.<span class="ruby-identifier">new</span>(<span class="ruby-string">"Imbalanced single quotes"</span>) <span class="ruby-keyword">if</span> <span class="ruby-identifier">in_single_quotes</span> <span class="ruby-operator">!=</span> <span class="ruby-keyword">false</span>
 <span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>.<span class="ruby-identifier">new</span>(<span class="ruby-string">"Imbalanced double quotes"</span>) <span class="ruby-keyword">if</span> <span class="ruby-identifier">in_double_quotes</span> <span class="ruby-operator">!=</span> <span class="ruby-keyword">false</span>
 <span class="ruby-keyword">return</span> <span class="ruby-keyword">nil</span>
 <span class="ruby-keyword">end</span>
 <span class="ruby-keyword">return</span> <span class="ruby-identifier">parenthesis</span> <span class="ruby-operator">==</span> <span class="ruby-value">0</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">in_single_quotes</span> <span class="ruby-operator">==</span> <span class="ruby-keyword">false</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">in_double_quotes</span> <span class="ruby-operator">==</span> <span class="ruby-keyword">false</span>
<span class="ruby-keyword">end</span></pre>
|
148
|
+
</div>
|
149
|
+
</div>
|
150
|
+
<div class='method public-instance' id='method-method-i-to_json'>
|
151
|
+
<a name='method-i-to_json'></a>
|
152
|
+
<div class='synopsis'>
|
153
|
+
<span class='name'>to_json</span>
|
154
|
+
<span class='arguments'>()</span>
|
155
|
+
|
156
|
+
</div>
|
157
|
+
<div class='description'>
|
158
|
+
|
159
|
+
</div>
|
160
|
+
<div class='source'>
|
161
|
+
<a class='source-toggle' href='#' onclick='toggleCode('method-i-to_json-source'); return false'>
|
162
|
+
[show source]
|
163
|
+
</a>
|
164
|
+
<pre id='method-i-to_json-source'><span class="ruby-comment"># File lib/gnip_api/power_track/rule.rb, line 13</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">to_json</span>
 <span class="ruby-identifier">attributes</span>.<span class="ruby-identifier">to_json</span>
<span class="ruby-keyword">end</span></pre>
|
165
|
+
</div>
|
166
|
+
</div>
|
167
|
+
<div class='method public-instance' id='method-method-i-uid'>
|
168
|
+
<a name='method-i-uid'></a>
|
169
|
+
<div class='synopsis'>
|
170
|
+
<span class='name'>uid</span>
|
171
|
+
<span class='arguments'>()</span>
|
172
|
+
|
173
|
+
</div>
|
174
|
+
<div class='description'>
|
175
|
+
|
176
|
+
</div>
|
177
|
+
<div class='source'>
|
178
|
+
<a class='source-toggle' href='#' onclick='toggleCode('method-i-uid-source'); return false'>
|
179
|
+
[show source]
|
180
|
+
</a>
|
181
|
+
<pre id='method-i-uid-source'><span class="ruby-comment"># File lib/gnip_api/power_track/rule.rb, line 25</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">uid</span>
 <span class="ruby-identifier">rule</span> = <span class="ruby-ivar">@value</span>
 <span class="ruby-identifier">rule</span> <span class="ruby-operator">+=</span> <span class="ruby-node">"tag:#{@tag}"</span> <span class="ruby-keyword">if</span> <span class="ruby-ivar">@tag</span>
 <span class="ruby-constant">Digest</span><span class="ruby-operator">::</span><span class="ruby-constant">SHA2</span>.<span class="ruby-identifier">hexdigest</span>(<span class="ruby-identifier">rule</span>)
<span class="ruby-keyword">end</span></pre>
|
182
|
+
</div>
|
183
|
+
</div>
|
184
|
+
</div>
|
185
|
+
</div>
|
186
|
+
|
187
|
+
</div>
|
188
|
+
</div>
|
189
|
+
|
190
|
+
<div id='footer-push'></div>
|
191
|
+
</div>
|
192
|
+
<div id='footer'>
|
193
|
+
<a href="https://github.com/rdoc/hanna-nouveau"><strong>Hanna Nouveau</strong> RDoc template</a>
|
194
|
+
</div>
|
195
|
+
</body>
|
196
|
+
</html>
|