pupil 0.1.4 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,6 @@
1
+ lib/**/*.rb
2
+ lib/*.rb
3
+ bin/*
4
+ -
5
+ features/**/*.feature
6
+ LICENSE.txt
data/.rspec ADDED
@@ -0,0 +1 @@
1
+ --color
@@ -1,3 +1,9 @@
1
+ 0.1.5 / Unreleased
2
+ ----------------
3
+
4
+ * Pupil::Stream Error handling(Pupil::Stream::StreamError) are rejected.
5
+
6
+
1
7
  0.1.4
2
8
  ----------------
3
9
 
@@ -0,0 +1,19 @@
1
+ = pupil
2
+
3
+ Pupil is lazy Twitter API Wrapper for Ruby 1.9.x
4
+
5
+ == Contributing to pupil
6
+
7
+ * Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
8
+ * Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it
9
+ * Fork the project
10
+ * Start a feature/bugfix branch
11
+ * Commit and push until you are happy with your contribution
12
+ * Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
13
+ * Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
14
+
15
+ == Copyright
16
+
17
+ Copyright (c) 2011 Oame. See LICENSE.txt for
18
+ further details.
19
+
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.4
1
+ 0.1.5
@@ -1,7 +1,6 @@
1
1
  class Pupil
2
2
  class Stream
3
3
  attr_reader :screen_name
4
- class StreamError < StandardError ; end
5
4
  STREAM_APIS = {
6
5
  :userstream => "https://userstream.twitter.com/2/user.json",
7
6
  :search => "https://stream.twitter.com/1/statuses/filter.json%s"
@@ -37,32 +36,28 @@ class Pupil
37
36
  https.verify_depth = 5
38
37
 
39
38
  while true do
40
- begin
41
- https.start do |https|
42
- request = Net::HTTP::Get.new(uri.request_uri)
43
- request["User-Agent"] = "Ruby/#{RUBY_VERSION} Pupil::Stream"
44
- request.oauth!(https, @consumer, @access_token)
45
- buf = ""
46
- https.request(request) do |response|
47
- response.read_body do |chunk|
48
- buf << chunk
49
- while (line = buf[/.+?(\r\n)+/m]) != nil
50
- begin
51
- buf.sub!(line,"")
52
- line.strip!
53
- status = JSON.parse(line)
54
- rescue
55
- break
56
- end
57
-
58
- event = self.guess_event status
59
- block.call event
39
+ https.start do |https|
40
+ request = Net::HTTP::Get.new(uri.request_uri)
41
+ request["User-Agent"] = "Ruby/#{RUBY_VERSION} Pupil::Stream"
42
+ request.oauth!(https, @consumer, @access_token)
43
+ buf = ""
44
+ https.request(request) do |response|
45
+ response.read_body do |chunk|
46
+ buf << chunk
47
+ while (line = buf[/.+?(\r\n)+/m]) != nil
48
+ begin
49
+ buf.sub!(line,"")
50
+ line.strip!
51
+ status = JSON.parse(line)
52
+ rescue
53
+ break
60
54
  end
55
+
56
+ event = self.guess_event status
57
+ block.call event
61
58
  end
62
59
  end
63
60
  end
64
- rescue => vars
65
- raise StreamError, "StreamError: #{vars}"
66
61
  end
67
62
  end
68
63
  end
@@ -5,56 +5,29 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "pupil"
8
- s.version = "0.1.4"
8
+ s.version = "0.1.5"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Oame"]
12
- s.date = "2011-12-29"
12
+ s.date = "2012-01-07"
13
13
  s.description = "The \"Lazy\" Twitter API Library for Ruby 1.9.x. Easy to use."
14
14
  s.email = "oame@oameya.com"
15
15
  s.extra_rdoc_files = [
16
16
  "LICENSE.txt",
17
- "README.md"
17
+ "README.md",
18
+ "README.rdoc"
18
19
  ]
19
20
  s.files = [
21
+ ".document",
22
+ ".rspec",
20
23
  "CHANGELOG.md",
21
24
  "Gemfile",
22
25
  "Gemfile.lock",
23
26
  "LICENSE.txt",
24
27
  "README.md",
28
+ "README.rdoc",
25
29
  "Rakefile",
26
30
  "VERSION",
27
- "doc/Pupil.html",
28
- "doc/Pupil/DirectMessage.html",
29
- "doc/Pupil/Entities.html",
30
- "doc/Pupil/Hashtag.html",
31
- "doc/Pupil/Keygen.html",
32
- "doc/Pupil/Keygen/MissingRequiredTokens.html",
33
- "doc/Pupil/List.html",
34
- "doc/Pupil/NetworkError.html",
35
- "doc/Pupil/Status.html",
36
- "doc/Pupil/Stream.html",
37
- "doc/Pupil/Stream/Shash.html",
38
- "doc/Pupil/Stream/Status.html",
39
- "doc/Pupil/Stream/StreamError.html",
40
- "doc/Pupil/URL.html",
41
- "doc/Pupil/UnsupportedParameter.html",
42
- "doc/Pupil/User.html",
43
- "doc/_index.html",
44
- "doc/class_list.html",
45
- "doc/css/common.css",
46
- "doc/css/full_list.css",
47
- "doc/css/style.css",
48
- "doc/file.LICENSE.html",
49
- "doc/file.README.html",
50
- "doc/file_list.html",
51
- "doc/frames.html",
52
- "doc/index.html",
53
- "doc/js/app.js",
54
- "doc/js/full_list.js",
55
- "doc/js/jquery.js",
56
- "doc/method_list.html",
57
- "doc/top-level-namespace.html",
58
31
  "lib/pupil.rb",
59
32
  "lib/pupil/account.rb",
60
33
  "lib/pupil/base.rb",
@@ -71,6 +44,7 @@ Gem::Specification.new do |s|
71
44
  "lib/pupil/stream/base.rb",
72
45
  "lib/pupil/users.rb",
73
46
  "pupil.gemspec",
47
+ "samples/ff-dumper.rb",
74
48
  "samples/generate-key.rb",
75
49
  "spec/pupil_spec.rb",
76
50
  "spec/spec_helper.rb"
@@ -0,0 +1,19 @@
1
+ #!/usr/bin/env ruby
2
+ # -*- coding: utf-8 -*-
3
+ # only 1.9.2
4
+
5
+ $LOAD_PATH << File.join(File.dirname(File.expand_path(__FILE__)), "../")
6
+ require "lib/pupil"
7
+ require "yaml"
8
+
9
+ keygen = Pupil::Keygen.new({:consumer_key => "yIyK3TaGo5VJX7MdkS95g", :consumer_secret => "ukIvD6yqP8SNbFfaIqVNkqg08J33uvRvpGa1ktuRc"})
10
+ tokens = keygen.interactive
11
+
12
+ pupil = Pupil.new tokens
13
+ user = pupil.verify_credentials
14
+ friends = pupil.friends_ids user.screen_name
15
+ followers = pupil.followers_ids user.screen_name
16
+
17
+ open("ff.yml", "w") do |f|
18
+ f.puts({:friends => friends, :followers => followers}.to_yaml)
19
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pupil
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-12-29 00:00:00.000000000Z
12
+ date: 2012-01-07 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: oauth
16
- requirement: &70151989267360 !ruby/object:Gem::Requirement
16
+ requirement: &70291003102160 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70151989267360
24
+ version_requirements: *70291003102160
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: json
27
- requirement: &70151989266380 !ruby/object:Gem::Requirement
27
+ requirement: &70291003100160 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '0'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *70151989266380
35
+ version_requirements: *70291003100160
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: rspec
38
- requirement: &70151989265220 !ruby/object:Gem::Requirement
38
+ requirement: &70291003097540 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ~>
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: 2.3.0
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *70151989265220
46
+ version_requirements: *70291003097540
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: yard
49
- requirement: &70151989263920 !ruby/object:Gem::Requirement
49
+ requirement: &70291003096360 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ~>
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: 0.6.0
55
55
  type: :development
56
56
  prerelease: false
57
- version_requirements: *70151989263920
57
+ version_requirements: *70291003096360
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: bundler
60
- requirement: &70151989262100 !ruby/object:Gem::Requirement
60
+ requirement: &70291003094740 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ~>
@@ -65,10 +65,10 @@ dependencies:
65
65
  version: 1.0.0
66
66
  type: :development
67
67
  prerelease: false
68
- version_requirements: *70151989262100
68
+ version_requirements: *70291003094740
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: jeweler
71
- requirement: &70151989246200 !ruby/object:Gem::Requirement
71
+ requirement: &70291003093000 !ruby/object:Gem::Requirement
72
72
  none: false
73
73
  requirements:
74
74
  - - ~>
@@ -76,10 +76,10 @@ dependencies:
76
76
  version: 1.6.4
77
77
  type: :development
78
78
  prerelease: false
79
- version_requirements: *70151989246200
79
+ version_requirements: *70291003093000
80
80
  - !ruby/object:Gem::Dependency
81
81
  name: rcov
82
- requirement: &70151989243220 !ruby/object:Gem::Requirement
82
+ requirement: &70291003091900 !ruby/object:Gem::Requirement
83
83
  none: false
84
84
  requirements:
85
85
  - - ! '>='
@@ -87,7 +87,7 @@ dependencies:
87
87
  version: '0'
88
88
  type: :development
89
89
  prerelease: false
90
- version_requirements: *70151989243220
90
+ version_requirements: *70291003091900
91
91
  description: The "Lazy" Twitter API Library for Ruby 1.9.x. Easy to use.
92
92
  email: oame@oameya.com
93
93
  executables: []
@@ -95,45 +95,18 @@ extensions: []
95
95
  extra_rdoc_files:
96
96
  - LICENSE.txt
97
97
  - README.md
98
+ - README.rdoc
98
99
  files:
100
+ - .document
101
+ - .rspec
99
102
  - CHANGELOG.md
100
103
  - Gemfile
101
104
  - Gemfile.lock
102
105
  - LICENSE.txt
103
106
  - README.md
107
+ - README.rdoc
104
108
  - Rakefile
105
109
  - VERSION
106
- - doc/Pupil.html
107
- - doc/Pupil/DirectMessage.html
108
- - doc/Pupil/Entities.html
109
- - doc/Pupil/Hashtag.html
110
- - doc/Pupil/Keygen.html
111
- - doc/Pupil/Keygen/MissingRequiredTokens.html
112
- - doc/Pupil/List.html
113
- - doc/Pupil/NetworkError.html
114
- - doc/Pupil/Status.html
115
- - doc/Pupil/Stream.html
116
- - doc/Pupil/Stream/Shash.html
117
- - doc/Pupil/Stream/Status.html
118
- - doc/Pupil/Stream/StreamError.html
119
- - doc/Pupil/URL.html
120
- - doc/Pupil/UnsupportedParameter.html
121
- - doc/Pupil/User.html
122
- - doc/_index.html
123
- - doc/class_list.html
124
- - doc/css/common.css
125
- - doc/css/full_list.css
126
- - doc/css/style.css
127
- - doc/file.LICENSE.html
128
- - doc/file.README.html
129
- - doc/file_list.html
130
- - doc/frames.html
131
- - doc/index.html
132
- - doc/js/app.js
133
- - doc/js/full_list.js
134
- - doc/js/jquery.js
135
- - doc/method_list.html
136
- - doc/top-level-namespace.html
137
110
  - lib/pupil.rb
138
111
  - lib/pupil/account.rb
139
112
  - lib/pupil/base.rb
@@ -150,6 +123,7 @@ files:
150
123
  - lib/pupil/stream/base.rb
151
124
  - lib/pupil/users.rb
152
125
  - pupil.gemspec
126
+ - samples/ff-dumper.rb
153
127
  - samples/generate-key.rb
154
128
  - spec/pupil_spec.rb
155
129
  - spec/spec_helper.rb
@@ -1,3451 +0,0 @@
1
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
- <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4
- <head>
5
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6
- <title>
7
- Class: Pupil
8
-
9
- &mdash; Documentation by YARD 0.7.4
10
-
11
- </title>
12
-
13
- <link rel="stylesheet" href="css/style.css" type="text/css" media="screen" charset="utf-8" />
14
-
15
- <link rel="stylesheet" href="css/common.css" type="text/css" media="screen" charset="utf-8" />
16
-
17
- <script type="text/javascript" charset="utf-8">
18
- relpath = '';
19
- if (relpath != '') relpath += '/';
20
- </script>
21
-
22
- <script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
23
-
24
- <script type="text/javascript" charset="utf-8" src="js/app.js"></script>
25
-
26
-
27
- </head>
28
- <body>
29
- <script type="text/javascript" charset="utf-8">
30
- if (window.top.frames.main) document.body.className = 'frames';
31
- </script>
32
-
33
- <div id="header">
34
- <div id="menu">
35
-
36
- <a href="_index.html">Index (P)</a> &raquo;
37
-
38
-
39
- <span class="title">Pupil</span>
40
-
41
-
42
- <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
43
- </div>
44
-
45
- <div id="search">
46
-
47
- <a id="class_list_link" href="#">Class List</a>
48
-
49
- <a id="method_list_link" href="#">Method List</a>
50
-
51
- <a id="file_list_link" href="#">File List</a>
52
-
53
- </div>
54
- <div class="clear"></div>
55
- </div>
56
-
57
- <iframe id="search_frame"></iframe>
58
-
59
- <div id="content"><h1>Class: Pupil
60
-
61
-
62
-
63
- </h1>
64
-
65
- <dl class="box">
66
-
67
- <dt class="r1">Inherits:</dt>
68
- <dd class="r1">
69
- <span class="inheritName">Object</span>
70
-
71
- <ul class="fullTree">
72
- <li>Object</li>
73
-
74
- <li class="next">Pupil</li>
75
-
76
- </ul>
77
- <a href="#" class="inheritanceTree">show all</a>
78
-
79
- </dd>
80
-
81
-
82
-
83
-
84
-
85
-
86
-
87
-
88
-
89
- <dt class="r2 last">Defined in:</dt>
90
- <dd class="r2 last">lib/pupil/base.rb<span class="defines">,<br />
91
- lib/pupil/users.rb,<br /> lib/pupil/lists.rb,<br /> lib/pupil/blocks.rb,<br /> lib/pupil/account.rb,<br /> lib/pupil/schemes.rb,<br /> lib/pupil/statuses.rb,<br /> lib/pupil/stream/base.rb,<br /> lib/pupil/friendships.rb,<br /> lib/pupil/keygen/base.rb,<br /> lib/pupil/direct_messages.rb</span>
92
- </dd>
93
-
94
- </dl>
95
- <div class="clear"></div>
96
-
97
- <h2>Defined Under Namespace</h2>
98
- <p class="children">
99
-
100
-
101
-
102
-
103
- <strong class="classes">Classes:</strong> <span class='object_link'><a href="Pupil/DirectMessage.html" title="Pupil::DirectMessage (class)">DirectMessage</a></span>, <span class='object_link'><a href="Pupil/Entities.html" title="Pupil::Entities (class)">Entities</a></span>, <span class='object_link'><a href="Pupil/Hashtag.html" title="Pupil::Hashtag (class)">Hashtag</a></span>, <span class='object_link'><a href="Pupil/Keygen.html" title="Pupil::Keygen (class)">Keygen</a></span>, <span class='object_link'><a href="Pupil/List.html" title="Pupil::List (class)">List</a></span>, <span class='object_link'><a href="Pupil/NetworkError.html" title="Pupil::NetworkError (class)">NetworkError</a></span>, <span class='object_link'><a href="Pupil/Status.html" title="Pupil::Status (class)">Status</a></span>, <span class='object_link'><a href="Pupil/Stream.html" title="Pupil::Stream (class)">Stream</a></span>, <span class='object_link'><a href="Pupil/URL.html" title="Pupil::URL (class)">URL</a></span>, <span class='object_link'><a href="Pupil/UnsupportedParameter.html" title="Pupil::UnsupportedParameter (class)">UnsupportedParameter</a></span>, <span class='object_link'><a href="Pupil/User.html" title="Pupil::User (class)">User</a></span>
104
-
105
-
106
- </p>
107
-
108
- <h2>Constant Summary</h2>
109
-
110
- <dl class="constants">
111
-
112
- <dt id="TWITTER_API_URL-constant" class="">TWITTER_API_URL =
113
-
114
- </dt>
115
- <dd><pre class="code"><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>http://api.twitter.com</span><span class='tstring_end'>&quot;</span></span></pre></dd>
116
-
117
- </dl>
118
-
119
-
120
-
121
- <h2>Instance Attribute Summary <small>(<a href="#" class="summary_toggle">collapse</a>)</small></h2>
122
- <ul class="summary">
123
-
124
- <li class="public ">
125
- <span class="summary_signature">
126
-
127
- <a href="#screen_name-instance_method" title="#screen_name (instance method)">- (Object) <strong>screen_name</strong> </a>
128
-
129
-
130
-
131
- </span>
132
-
133
-
134
- <span class="note title readonly">readonly</span>
135
-
136
-
137
-
138
-
139
-
140
-
141
-
142
-
143
- <span class="summary_desc"><div class='inline'><p>
144
- Returns the value of attribute screen_name.
145
- </p>
146
- </div></span>
147
-
148
- </li>
149
-
150
-
151
- </ul>
152
-
153
-
154
-
155
-
156
-
157
- <h2>
158
- Class Method Summary
159
- <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
160
- </h2>
161
-
162
- <ul class="summary">
163
-
164
- <li class="public ">
165
- <span class="summary_signature">
166
-
167
- <a href="#param_serializer-class_method" title="param_serializer (class method)">+ (String) <strong>param_serializer</strong>(parameter) </a>
168
-
169
-
170
-
171
- </span>
172
-
173
-
174
-
175
-
176
-
177
-
178
-
179
-
180
- <span class="summary_desc"><div class='inline'><p>
181
- URL Serialized parameters.
182
- </p>
183
- </div></span>
184
-
185
- </li>
186
-
187
-
188
- </ul>
189
-
190
- <h2>
191
- Instance Method Summary
192
- <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
193
- </h2>
194
-
195
- <ul class="summary">
196
-
197
- <li class="public ">
198
- <span class="summary_signature">
199
-
200
- <a href="#addlist-instance_method" title="#addlist (instance method)">- (Hash) <strong>addlist</strong>(listid, ids) </a>
201
-
202
-
203
-
204
- </span>
205
-
206
-
207
-
208
-
209
-
210
-
211
-
212
-
213
- <span class="summary_desc"><div class='inline'><p>
214
- Response.
215
- </p>
216
- </div></span>
217
-
218
- </li>
219
-
220
-
221
- <li class="public ">
222
- <span class="summary_signature">
223
-
224
- <a href="#block-instance_method" title="#block (instance method)">- (Pupil::User) <strong>block</strong>(param) </a>
225
-
226
-
227
-
228
- </span>
229
-
230
-
231
-
232
-
233
-
234
-
235
-
236
-
237
- <span class="summary_desc"><div class='inline'><p>
238
- Response.
239
- </p>
240
- </div></span>
241
-
242
- </li>
243
-
244
-
245
- <li class="public ">
246
- <span class="summary_signature">
247
-
248
- <a href="#blocking-instance_method" title="#blocking (instance method)">- (Array) <strong>blocking</strong> </a>
249
-
250
-
251
-
252
- </span>
253
-
254
-
255
-
256
-
257
-
258
-
259
-
260
-
261
- <span class="summary_desc"><div class='inline'><p>
262
- List of blocking users.
263
- </p>
264
- </div></span>
265
-
266
- </li>
267
-
268
-
269
- <li class="public ">
270
- <span class="summary_signature">
271
-
272
- <a href="#destroy-instance_method" title="#destroy (instance method)">- (Object) <strong>destroy</strong>(status_id) </a>
273
-
274
-
275
-
276
- </span>
277
-
278
-
279
-
280
-
281
-
282
-
283
-
284
-
285
- <span class="summary_desc"><div class='inline'></div></span>
286
-
287
- </li>
288
-
289
-
290
- <li class="public ">
291
- <span class="summary_signature">
292
-
293
- <a href="#dm-instance_method" title="#dm (instance method)">- (Hash) <strong>dm</strong>(param = {}) </a>
294
-
295
-
296
-
297
- </span>
298
-
299
-
300
-
301
-
302
-
303
-
304
-
305
-
306
- <span class="summary_desc"><div class='inline'><p>
307
- Returning direct messages.
308
- </p>
309
- </div></span>
310
-
311
- </li>
312
-
313
-
314
- <li class="public ">
315
- <span class="summary_signature">
316
-
317
- <a href="#dm_destroy-instance_method" title="#dm_destroy (instance method)">- (Hash) <strong>dm_destroy</strong>(dm_id) </a>
318
-
319
-
320
-
321
- </span>
322
-
323
-
324
-
325
-
326
-
327
-
328
-
329
-
330
- <span class="summary_desc"><div class='inline'><p>
331
- Delete direct message.
332
- </p>
333
- </div></span>
334
-
335
- </li>
336
-
337
-
338
- <li class="public ">
339
- <span class="summary_signature">
340
-
341
- <a href="#dm_sent-instance_method" title="#dm_sent (instance method)">- (Hash) <strong>dm_sent</strong>(param = {}) </a>
342
-
343
-
344
-
345
- </span>
346
-
347
-
348
-
349
-
350
-
351
-
352
-
353
-
354
- <span class="summary_desc"><div class='inline'><p>
355
- Returning direct messages you sent.
356
- </p>
357
- </div></span>
358
-
359
- </li>
360
-
361
-
362
- <li class="public ">
363
- <span class="summary_signature">
364
-
365
- <a href="#end_session-instance_method" title="#end_session (instance method)">- (Hash) <strong>end_session</strong> </a>
366
-
367
-
368
-
369
- </span>
370
-
371
-
372
-
373
-
374
-
375
-
376
-
377
-
378
- <span class="summary_desc"><div class='inline'><p>
379
- End oauth session.
380
- </p>
381
- </div></span>
382
-
383
- </li>
384
-
385
-
386
- <li class="public ">
387
- <span class="summary_signature">
388
-
389
- <a href="#follow-instance_method" title="#follow (instance method)">- (Hash) <strong>follow</strong>(param) </a>
390
-
391
-
392
-
393
- </span>
394
-
395
-
396
-
397
-
398
-
399
-
400
-
401
-
402
- <span class="summary_desc"><div class='inline'><p>
403
- Follow user for screen_name.
404
- </p>
405
- </div></span>
406
-
407
- </li>
408
-
409
-
410
- <li class="public ">
411
- <span class="summary_signature">
412
-
413
- <a href="#followers_ids-instance_method" title="#followers_ids (instance method)">- (Object) <strong>followers_ids</strong>(name = @screen_name) </a>
414
-
415
-
416
-
417
- </span>
418
-
419
-
420
-
421
-
422
-
423
-
424
-
425
-
426
- <span class="summary_desc"><div class='inline'></div></span>
427
-
428
- </li>
429
-
430
-
431
- <li class="public ">
432
- <span class="summary_signature">
433
-
434
- <a href="#friends_ids-instance_method" title="#friends_ids (instance method)">- (Object) <strong>friends_ids</strong>(name) </a>
435
-
436
-
437
-
438
- </span>
439
-
440
-
441
-
442
-
443
-
444
-
445
-
446
-
447
- <span class="summary_desc"><div class='inline'></div></span>
448
-
449
- </li>
450
-
451
-
452
- <li class="public ">
453
- <span class="summary_signature">
454
-
455
- <a href="#friendship%3F-instance_method" title="#friendship? (instance method)">- (Boolean) <strong>friendship?</strong>(src, dst) </a>
456
-
457
-
458
-
459
- (also: #relationship?, #friendships_exists?)
460
-
461
- </span>
462
-
463
-
464
-
465
-
466
-
467
-
468
-
469
-
470
- <span class="summary_desc"><div class='inline'><p>
471
- Check friendships.
472
- </p>
473
- </div></span>
474
-
475
- </li>
476
-
477
-
478
- <li class="public ">
479
- <span class="summary_signature">
480
-
481
- <a href="#get-instance_method" title="#get (instance method)">- (Object) <strong>get</strong>(url, param = {}) </a>
482
-
483
-
484
-
485
- </span>
486
-
487
-
488
-
489
-
490
-
491
-
492
-
493
-
494
- <span class="summary_desc"><div class='inline'></div></span>
495
-
496
- </li>
497
-
498
-
499
- <li class="public ">
500
- <span class="summary_signature">
501
-
502
- <a href="#home_timeline-instance_method" title="#home_timeline (instance method)">- (Array) <strong>home_timeline</strong>(param = {}) </a>
503
-
504
-
505
-
506
- </span>
507
-
508
-
509
-
510
-
511
-
512
-
513
-
514
-
515
- <span class="summary_desc"><div class='inline'><p>
516
- Timeline.
517
- </p>
518
- </div></span>
519
-
520
- </li>
521
-
522
-
523
- <li class="public ">
524
- <span class="summary_signature">
525
-
526
- <a href="#initialize-instance_method" title="#initialize (instance method)">- (Pupil) <strong>initialize</strong>(key) </a>
527
-
528
-
529
-
530
- </span>
531
-
532
- <span class="note title constructor">constructor</span>
533
-
534
-
535
-
536
-
537
-
538
-
539
-
540
-
541
- <span class="summary_desc"><div class='inline'><p>
542
- A new instance of Pupil.
543
- </p>
544
- </div></span>
545
-
546
- </li>
547
-
548
-
549
- <li class="public ">
550
- <span class="summary_signature">
551
-
552
- <a href="#lists-instance_method" title="#lists (instance method)">- (Hash) <strong>lists</strong> </a>
553
-
554
-
555
-
556
- </span>
557
-
558
-
559
-
560
-
561
-
562
-
563
-
564
-
565
- <span class="summary_desc"><div class='inline'><p>
566
- Lists.
567
- </p>
568
- </div></span>
569
-
570
- </li>
571
-
572
-
573
- <li class="public ">
574
- <span class="summary_signature">
575
-
576
- <a href="#lists_member_create-instance_method" title="#lists_member_create (instance method)">- (Object) <strong>lists_member_create</strong>(listid, id) </a>
577
-
578
-
579
-
580
- </span>
581
-
582
-
583
-
584
-
585
-
586
-
587
-
588
-
589
- <span class="summary_desc"><div class='inline'></div></span>
590
-
591
- </li>
592
-
593
-
594
- <li class="public ">
595
- <span class="summary_signature">
596
-
597
- <a href="#lookup-instance_method" title="#lookup (instance method)">- (Object) <strong>lookup</strong>(param = {}) </a>
598
-
599
-
600
-
601
- </span>
602
-
603
-
604
-
605
-
606
-
607
-
608
-
609
-
610
- <span class="summary_desc"><div class='inline'></div></span>
611
-
612
- </li>
613
-
614
-
615
- <li class="public ">
616
- <span class="summary_signature">
617
-
618
- <a href="#mentions-instance_method" title="#mentions (instance method)">- (Hash) <strong>mentions</strong>(param = {}) </a>
619
-
620
-
621
-
622
- </span>
623
-
624
-
625
-
626
-
627
-
628
-
629
-
630
-
631
- <span class="summary_desc"><div class='inline'><p>
632
- Mention.
633
- </p>
634
- </div></span>
635
-
636
- </li>
637
-
638
-
639
- <li class="public ">
640
- <span class="summary_signature">
641
-
642
- <a href="#param_serializer-instance_method" title="#param_serializer (instance method)">- (Object) <strong>param_serializer</strong>(parameter) </a>
643
-
644
-
645
-
646
- </span>
647
-
648
-
649
-
650
-
651
-
652
-
653
-
654
-
655
- <span class="summary_desc"><div class='inline'></div></span>
656
-
657
- </li>
658
-
659
-
660
- <li class="public ">
661
- <span class="summary_signature">
662
-
663
- <a href="#post-instance_method" title="#post (instance method)">- (Object) <strong>post</strong>(url, param = {}) </a>
664
-
665
-
666
-
667
- </span>
668
-
669
-
670
-
671
-
672
-
673
-
674
-
675
-
676
- <span class="summary_desc"><div class='inline'></div></span>
677
-
678
- </li>
679
-
680
-
681
- <li class="public ">
682
- <span class="summary_signature">
683
-
684
- <a href="#rate_limit-instance_method" title="#rate_limit (instance method)">- (Hash) <strong>rate_limit</strong> </a>
685
-
686
-
687
-
688
- </span>
689
-
690
-
691
-
692
-
693
-
694
-
695
-
696
-
697
- <span class="summary_desc"><div class='inline'><p>
698
- Rate limit statuses.
699
- </p>
700
- </div></span>
701
-
702
- </li>
703
-
704
-
705
- <li class="public ">
706
- <span class="summary_signature">
707
-
708
- <a href="#show_status-instance_method" title="#show_status (instance method)">- (Object) <strong>show_status</strong>(status_id) </a>
709
-
710
-
711
-
712
- </span>
713
-
714
-
715
-
716
-
717
-
718
-
719
-
720
-
721
- <span class="summary_desc"><div class='inline'></div></span>
722
-
723
- </li>
724
-
725
-
726
- <li class="public ">
727
- <span class="summary_signature">
728
-
729
- <a href="#unblock-instance_method" title="#unblock (instance method)">- (Pupil::User) <strong>unblock</strong>(param) </a>
730
-
731
-
732
-
733
- </span>
734
-
735
-
736
-
737
-
738
-
739
-
740
-
741
-
742
- <span class="summary_desc"><div class='inline'><p>
743
- Response.
744
- </p>
745
- </div></span>
746
-
747
- </li>
748
-
749
-
750
- <li class="public ">
751
- <span class="summary_signature">
752
-
753
- <a href="#unfollow-instance_method" title="#unfollow (instance method)">- (Hash) <strong>unfollow</strong>(param) </a>
754
-
755
-
756
-
757
- </span>
758
-
759
-
760
-
761
-
762
-
763
-
764
-
765
-
766
- <span class="summary_desc"><div class='inline'><p>
767
- Unfollow user for screen_name.
768
- </p>
769
- </div></span>
770
-
771
- </li>
772
-
773
-
774
- <li class="public ">
775
- <span class="summary_signature">
776
-
777
- <a href="#update-instance_method" title="#update (instance method)">- (Object) <strong>update</strong>(status, irt = '') </a>
778
-
779
-
780
-
781
- (also: #tweet)
782
-
783
- </span>
784
-
785
-
786
-
787
-
788
-
789
-
790
-
791
-
792
- <span class="summary_desc"><div class='inline'></div></span>
793
-
794
- </li>
795
-
796
-
797
- <li class="public ">
798
- <span class="summary_signature">
799
-
800
- <a href="#update_profile-instance_method" title="#update_profile (instance method)">- (Pupil::User) <strong>update_profile</strong>(param) </a>
801
-
802
-
803
-
804
- </span>
805
-
806
-
807
-
808
-
809
-
810
-
811
-
812
-
813
- <span class="summary_desc"><div class='inline'><p>
814
- Update profile.
815
- </p>
816
- </div></span>
817
-
818
- </li>
819
-
820
-
821
- <li class="public ">
822
- <span class="summary_signature">
823
-
824
- <a href="#user_timeline-instance_method" title="#user_timeline (instance method)">- (Hash) <strong>user_timeline</strong>(param = {}) </a>
825
-
826
-
827
-
828
- </span>
829
-
830
-
831
-
832
-
833
-
834
-
835
-
836
-
837
- <span class="summary_desc"><div class='inline'><p>
838
- Returning user timeline.
839
- </p>
840
- </div></span>
841
-
842
- </li>
843
-
844
-
845
- <li class="public ">
846
- <span class="summary_signature">
847
-
848
- <a href="#verify_credentials-instance_method" title="#verify_credentials (instance method)">- (Pupil::User) <strong>verify_credentials</strong> </a>
849
-
850
-
851
-
852
- </span>
853
-
854
-
855
-
856
-
857
-
858
-
859
-
860
-
861
- <span class="summary_desc"><div class='inline'><p>
862
- Verify credentials.
863
- </p>
864
- </div></span>
865
-
866
- </li>
867
-
868
-
869
- </ul>
870
-
871
-
872
- <div id="constructor_details" class="method_details_list">
873
- <h2>Constructor Details</h2>
874
-
875
- <div class="method_details first">
876
- <p class="signature first" id="initialize-instance_method">
877
-
878
- - (<tt><span class='object_link'><a href="" title="Pupil (class)">Pupil</a></span></tt>) <strong>initialize</strong>(key)
879
-
880
-
881
-
882
- </p><div class="docstring">
883
- <div class="discussion">
884
- <p>
885
- A new instance of Pupil
886
- </p>
887
-
888
-
889
- </div>
890
- </div>
891
- <div class="tags">
892
- <h3>Parameters:</h3>
893
- <ul class="param">
894
-
895
- <li>
896
-
897
- <span class='name'>pupil_key</span>
898
-
899
-
900
- <span class='type'>(<tt>Hash</tt>)</span>
901
-
902
-
903
-
904
- </li>
905
-
906
- </ul>
907
-
908
-
909
- </div><table class="source_code">
910
- <tr>
911
- <td>
912
- <pre class="lines">
913
-
914
-
915
- 15
916
- 16
917
- 17
918
- 18
919
- 19
920
- 20
921
- 21
922
- 22
923
- 23
924
- 24
925
- 25
926
- 26
927
- 27
928
- 28</pre>
929
- </td>
930
- <td>
931
- <pre class="code"><span class="info file"># File 'lib/pupil/base.rb', line 15</span>
932
-
933
- <span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span> <span class='id identifier rubyid_key'>key</span>
934
- <span class='ivar'>@screen_name</span> <span class='op'>=</span> <span class='id identifier rubyid_key'>key</span><span class='lbracket'>[</span><span class='symbol'>:screen_name</span><span class='rbracket'>]</span>
935
-
936
- <span class='ivar'>@consumer</span> <span class='op'>=</span> <span class='const'>OAuth</span><span class='op'>::</span><span class='const'>Consumer</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span>
937
- <span class='id identifier rubyid_key'>key</span><span class='lbracket'>[</span><span class='symbol'>:consumer_key</span><span class='rbracket'>]</span><span class='comma'>,</span>
938
- <span class='id identifier rubyid_key'>key</span><span class='lbracket'>[</span><span class='symbol'>:consumer_secret</span><span class='rbracket'>]</span><span class='comma'>,</span>
939
- <span class='symbol'>:site</span> <span class='op'>=&gt;</span> <span class='const'>TWITTER_API_URL</span>
940
- <span class='rparen'>)</span>
941
- <span class='ivar'>@access_token</span> <span class='op'>=</span> <span class='const'>OAuth</span><span class='op'>::</span><span class='const'>AccessToken</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span>
942
- <span class='ivar'>@consumer</span><span class='comma'>,</span>
943
- <span class='id identifier rubyid_key'>key</span><span class='lbracket'>[</span><span class='symbol'>:access_token</span><span class='rbracket'>]</span><span class='comma'>,</span>
944
- <span class='id identifier rubyid_key'>key</span><span class='lbracket'>[</span><span class='symbol'>:access_token_secret</span><span class='rbracket'>]</span>
945
- <span class='rparen'>)</span>
946
- <span class='kw'>end</span></pre>
947
- </td>
948
- </tr>
949
- </table>
950
- </div>
951
-
952
- </div>
953
-
954
- <div id="instance_attr_details" class="attr_details">
955
- <h2>Instance Attribute Details</h2>
956
-
957
-
958
- <span id=""></span>
959
- <span id="screen_name-instance_method"></span>
960
- <div class="method_details first">
961
- <p class="signature first" id="screen_name-instance_method">
962
-
963
- - (<tt>Object</tt>) <strong>screen_name</strong> <span class="extras">(readonly)</span>
964
-
965
-
966
-
967
- </p><div class="docstring">
968
- <div class="discussion">
969
- <p>
970
- Returns the value of attribute screen_name
971
- </p>
972
-
973
-
974
- </div>
975
- </div>
976
- <div class="tags">
977
-
978
-
979
- </div><table class="source_code">
980
- <tr>
981
- <td>
982
- <pre class="lines">
983
-
984
-
985
- 8
986
- 9
987
- 10</pre>
988
- </td>
989
- <td>
990
- <pre class="code"><span class="info file"># File 'lib/pupil/base.rb', line 8</span>
991
-
992
- <span class='kw'>def</span> <span class='id identifier rubyid_screen_name'>screen_name</span>
993
- <span class='ivar'>@screen_name</span>
994
- <span class='kw'>end</span></pre>
995
- </td>
996
- </tr>
997
- </table>
998
- </div>
999
-
1000
- </div>
1001
-
1002
-
1003
- <div id="class_method_details" class="method_details_list">
1004
- <h2>Class Method Details</h2>
1005
-
1006
-
1007
- <div class="method_details first">
1008
- <p class="signature first" id="param_serializer-class_method">
1009
-
1010
- + (<tt>String</tt>) <strong>param_serializer</strong>(parameter)
1011
-
1012
-
1013
-
1014
- </p><div class="docstring">
1015
- <div class="discussion">
1016
- <p>
1017
- URL Serialized parameters
1018
- </p>
1019
-
1020
-
1021
- </div>
1022
- </div>
1023
- <div class="tags">
1024
- <h3>Parameters:</h3>
1025
- <ul class="param">
1026
-
1027
- <li>
1028
-
1029
- <span class='name'>parameter</span>
1030
-
1031
-
1032
- <span class='type'>(<tt>Hash</tt>)</span>
1033
-
1034
-
1035
-
1036
- </li>
1037
-
1038
- </ul>
1039
-
1040
- <h3>Returns:</h3>
1041
- <ul class="return">
1042
-
1043
- <li>
1044
-
1045
-
1046
- <span class='type'>(<tt>String</tt>)</span>
1047
-
1048
-
1049
-
1050
- &mdash;
1051
- <div class='inline'><p>
1052
- URL Serialized parameters
1053
- </p>
1054
- </div>
1055
-
1056
- </li>
1057
-
1058
- </ul>
1059
-
1060
- </div><table class="source_code">
1061
- <tr>
1062
- <td>
1063
- <pre class="lines">
1064
-
1065
-
1066
- 32
1067
- 33
1068
- 34
1069
- 35
1070
- 36
1071
- 37
1072
- 38
1073
- 39
1074
- 40
1075
- 41
1076
- 42
1077
- 43
1078
- 44
1079
- 45
1080
- 46
1081
- 47
1082
- 48
1083
- 49
1084
- 50
1085
- 51
1086
- 52
1087
- 53
1088
- 54
1089
- 55
1090
- 56
1091
- 57
1092
- 58
1093
- 59
1094
- 60
1095
- 61
1096
- 62</pre>
1097
- </td>
1098
- <td>
1099
- <pre class="code"><span class="info file"># File 'lib/pupil/base.rb', line 32</span>
1100
-
1101
- <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_param_serializer'>param_serializer</span> <span class='id identifier rubyid_parameter'>parameter</span>
1102
- <span class='kw'>return</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_end'>&quot;</span></span> <span class='kw'>unless</span> <span class='id identifier rubyid_parameter'>parameter</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span> <span class='op'>==</span> <span class='const'>Hash</span>
1103
- <span class='id identifier rubyid_ant'>ant</span> <span class='op'>=</span> <span class='const'>Hash</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
1104
- <span class='id identifier rubyid_parameter'>parameter</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_key'>key</span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span><span class='op'>|</span>
1105
- <span class='kw'>case</span> <span class='id identifier rubyid_key'>key</span><span class='period'>.</span><span class='id identifier rubyid_to_sym'>to_sym</span>
1106
- <span class='kw'>when</span> <span class='symbol'>:include</span>
1107
- <span class='kw'>if</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span> <span class='op'>==</span> <span class='const'>String</span> <span class='op'>||</span> <span class='const'>Symbol</span>
1108
- <span class='id identifier rubyid_ant'>ant</span><span class='lbracket'>[</span><span class='symbol'>:include_</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_value'>value</span><span class='rbrace'>}</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='symbol'>:true</span>
1109
- <span class='kw'>break</span>
1110
- <span class='kw'>end</span>
1111
-
1112
- <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_element'>element</span><span class='op'>|</span>
1113
- <span class='id identifier rubyid_raise'>raise</span> <span class='const'>UnsupportedParameter</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>include_entities is not supported.</span><span class='tstring_end'>&quot;</span></span> <span class='kw'>if</span> <span class='id identifier rubyid_element'>element</span><span class='period'>.</span><span class='id identifier rubyid_to_sym'>to_sym</span> <span class='op'>==</span> <span class='symbol'>:entities</span>
1114
- <span class='id identifier rubyid_ant'>ant</span><span class='lbracket'>[</span><span class='symbol'>:include_</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_element'>element</span><span class='rbrace'>}</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='symbol'>:true</span>
1115
- <span class='kw'>end</span>
1116
- <span class='kw'>when</span> <span class='symbol'>:exclude</span>
1117
- <span class='kw'>if</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span> <span class='op'>==</span> <span class='const'>String</span> <span class='op'>||</span> <span class='const'>Symbol</span>
1118
- <span class='id identifier rubyid_ant'>ant</span><span class='lbracket'>[</span><span class='symbol'>:exclude_</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_value'>value</span><span class='rbrace'>}</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='symbol'>:true</span>
1119
- <span class='kw'>break</span>
1120
- <span class='kw'>end</span>
1121
-
1122
- <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_element'>element</span><span class='op'>|</span>
1123
- <span class='id identifier rubyid_ant'>ant</span><span class='lbracket'>[</span><span class='symbol'>:exclude_</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_element'>element</span><span class='rbrace'>}</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='symbol'>:true</span>
1124
- <span class='kw'>end</span>
1125
- <span class='kw'>else</span>
1126
- <span class='id identifier rubyid_ant'>ant</span><span class='lbracket'>[</span><span class='id identifier rubyid_key'>key</span><span class='period'>.</span><span class='id identifier rubyid_to_sym'>to_sym</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span>
1127
- <span class='kw'>end</span>
1128
- <span class='kw'>end</span>
1129
- <span class='id identifier rubyid_param'>param</span> <span class='op'>=</span> <span class='id identifier rubyid_ant'>ant</span><span class='period'>.</span><span class='id identifier rubyid_inject'>inject</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span><span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_k'>k</span><span class='comma'>,</span><span class='id identifier rubyid_v'>v</span><span class='op'>|</span><span class='id identifier rubyid_k'>k</span><span class='op'>+</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>&amp;</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_v'>v</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span><span class='rbrace'>}</span><span class='tstring_content'>=</span><span class='embexpr_beg'>#{</span><span class='const'>URI</span><span class='period'>.</span><span class='id identifier rubyid_escape'>escape</span><span class='lparen'>(</span><span class='id identifier rubyid_v'>v</span><span class='lbracket'>[</span><span class='int'>1</span><span class='rbracket'>]</span><span class='rparen'>)</span><span class='rbrace'>}</span><span class='tstring_end'>&quot;</span></span><span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_sub!'>sub!</span><span class='lparen'>(</span><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>^&amp;</span><span class='regexp_end'>/</span></span><span class='comma'>,</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>?</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
1130
- <span class='kw'>return</span> <span class='id identifier rubyid_param'>param</span> <span class='op'>?</span> <span class='id identifier rubyid_param'>param</span> <span class='op'>:</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_end'>&quot;</span></span>
1131
- <span class='kw'>end</span></pre>
1132
- </td>
1133
- </tr>
1134
- </table>
1135
- </div>
1136
-
1137
- </div>
1138
-
1139
- <div id="instance_method_details" class="method_details_list">
1140
- <h2>Instance Method Details</h2>
1141
-
1142
-
1143
- <div class="method_details first">
1144
- <p class="signature first" id="addlist-instance_method">
1145
-
1146
- - (<tt>Hash</tt>) <strong>addlist</strong>(listid, ids)
1147
-
1148
-
1149
-
1150
- </p><div class="docstring">
1151
- <div class="discussion">
1152
- <p>
1153
- Response
1154
- </p>
1155
-
1156
-
1157
- </div>
1158
- </div>
1159
- <div class="tags">
1160
- <h3>Parameters:</h3>
1161
- <ul class="param">
1162
-
1163
- <li>
1164
-
1165
- <span class='name'>id</span>
1166
-
1167
-
1168
- <span class='type'>(<tt>Fixnum</tt>)</span>
1169
-
1170
-
1171
-
1172
- &mdash;
1173
- <div class='inline'><p>
1174
- list id
1175
- </p>
1176
- </div>
1177
-
1178
- </li>
1179
-
1180
- <li>
1181
-
1182
- <span class='name'>ids</span>
1183
-
1184
-
1185
- <span class='type'>(<tt>String</tt>)</span>
1186
-
1187
-
1188
-
1189
- &mdash;
1190
- <div class='inline'><p>
1191
- id comma separated
1192
- </p>
1193
- </div>
1194
-
1195
- </li>
1196
-
1197
- </ul>
1198
-
1199
- <h3>Returns:</h3>
1200
- <ul class="return">
1201
-
1202
- <li>
1203
-
1204
-
1205
- <span class='type'>(<tt>Hash</tt>)</span>
1206
-
1207
-
1208
-
1209
- &mdash;
1210
- <div class='inline'><p>
1211
- response
1212
- </p>
1213
- </div>
1214
-
1215
- </li>
1216
-
1217
- </ul>
1218
-
1219
- </div><table class="source_code">
1220
- <tr>
1221
- <td>
1222
- <pre class="lines">
1223
-
1224
-
1225
- 5
1226
- 6
1227
- 7
1228
- 8</pre>
1229
- </td>
1230
- <td>
1231
- <pre class="code"><span class="info file"># File 'lib/pupil/lists.rb', line 5</span>
1232
-
1233
- <span class='kw'>def</span> <span class='id identifier rubyid_addlist'>addlist</span><span class='lparen'>(</span><span class='id identifier rubyid_listid'>listid</span><span class='comma'>,</span><span class='id identifier rubyid_ids'>ids</span><span class='rparen'>)</span>
1234
- <span class='id identifier rubyid_response'>response</span> <span class='op'>=</span> <span class='ivar'>@access_token</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>http://api.twitter.com/1/</span><span class='embexpr_beg'>#{</span><span class='ivar'>@username</span><span class='rbrace'>}</span><span class='tstring_content'>/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_listid'>listid</span><span class='rbrace'>}</span><span class='tstring_content'>/create_all.xml?user_id=</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_ids'>ids</span><span class='rbrace'>}</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
1235
- <span class='kw'>return</span> <span class='id identifier rubyid_response'>response</span>
1236
- <span class='kw'>end</span></pre>
1237
- </td>
1238
- </tr>
1239
- </table>
1240
- </div>
1241
-
1242
- <div class="method_details ">
1243
- <p class="signature " id="block-instance_method">
1244
-
1245
- - (<tt><span class='object_link'><a href="Pupil/User.html" title="Pupil::User (class)">Pupil::User</a></span></tt>) <strong>block</strong>(param)
1246
-
1247
-
1248
-
1249
- </p><div class="docstring">
1250
- <div class="discussion">
1251
- <p>
1252
- Response
1253
- </p>
1254
-
1255
-
1256
- </div>
1257
- </div>
1258
- <div class="tags">
1259
- <h3>Parameters:</h3>
1260
- <ul class="param">
1261
-
1262
- <li>
1263
-
1264
- <span class='name'>id</span>
1265
-
1266
-
1267
- <span class='type'>(<tt>Fixnum</tt>)</span>
1268
-
1269
-
1270
-
1271
- &mdash;
1272
- <div class='inline'><p>
1273
- id
1274
- </p>
1275
- </div>
1276
-
1277
- </li>
1278
-
1279
- </ul>
1280
-
1281
- <h3>Returns:</h3>
1282
- <ul class="return">
1283
-
1284
- <li>
1285
-
1286
-
1287
- <span class='type'>(<tt><span class='object_link'><a href="Pupil/User.html" title="Pupil::User (class)">Pupil::User</a></span></tt>)</span>
1288
-
1289
-
1290
-
1291
- &mdash;
1292
- <div class='inline'><p>
1293
- response
1294
- </p>
1295
- </div>
1296
-
1297
- </li>
1298
-
1299
- </ul>
1300
-
1301
- </div><table class="source_code">
1302
- <tr>
1303
- <td>
1304
- <pre class="lines">
1305
-
1306
-
1307
- 4
1308
- 5
1309
- 6
1310
- 7
1311
- 8
1312
- 9
1313
- 10
1314
- 11
1315
- 12
1316
- 13
1317
- 14
1318
- 15
1319
- 16</pre>
1320
- </td>
1321
- <td>
1322
- <pre class="code"><span class="info file"># File 'lib/pupil/blocks.rb', line 4</span>
1323
-
1324
- <span class='kw'>def</span> <span class='id identifier rubyid_block'>block</span> <span class='id identifier rubyid_param'>param</span>
1325
- <span class='kw'>case</span> <span class='id identifier rubyid_param'>param</span><span class='period'>.</span><span class='id identifier rubyid_keys'>keys</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_to_sym'>to_sym</span>
1326
- <span class='kw'>when</span> <span class='symbol'>:screen_name</span>
1327
- <span class='id identifier rubyid_response'>response</span> <span class='op'>=</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>/blocks/create.json</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='lbrace'>{</span><span class='symbol'>:screen_name</span> <span class='op'>=&gt;</span> <span class='id identifier rubyid_param'>param</span><span class='period'>.</span><span class='id identifier rubyid_values'>values</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span><span class='rbrace'>}</span><span class='rparen'>)</span>
1328
- <span class='kw'>when</span> <span class='symbol'>:id</span>
1329
- <span class='id identifier rubyid_response'>response</span> <span class='op'>=</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>/blocks/create.json</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='lbrace'>{</span><span class='symbol'>:user_id</span> <span class='op'>=&gt;</span> <span class='id identifier rubyid_param'>param</span><span class='period'>.</span><span class='id identifier rubyid_values'>values</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span><span class='rbrace'>}</span><span class='rparen'>)</span>
1330
- <span class='kw'>end</span>
1331
-
1332
- <span class='kw'>if</span> <span class='id identifier rubyid_response'>response</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span> <span class='op'>==</span> <span class='const'>Hash</span> <span class='op'>&amp;&amp;</span> <span class='id identifier rubyid_response'>response</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>id</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span>
1333
- <span class='kw'>return</span> <span class='const'>User</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span> <span class='id identifier rubyid_response'>response</span>
1334
- <span class='kw'>end</span>
1335
- <span class='kw'>return</span> <span class='kw'>false</span>
1336
- <span class='kw'>end</span></pre>
1337
- </td>
1338
- </tr>
1339
- </table>
1340
- </div>
1341
-
1342
- <div class="method_details ">
1343
- <p class="signature " id="blocking-instance_method">
1344
-
1345
- - (<tt>Array</tt>) <strong>blocking</strong>
1346
-
1347
-
1348
-
1349
- </p><div class="docstring">
1350
- <div class="discussion">
1351
- <p>
1352
- List of blocking users
1353
- </p>
1354
-
1355
-
1356
- </div>
1357
- </div>
1358
- <div class="tags">
1359
-
1360
- <h3>Returns:</h3>
1361
- <ul class="return">
1362
-
1363
- <li>
1364
-
1365
-
1366
- <span class='type'>(<tt>Array</tt>)</span>
1367
-
1368
-
1369
-
1370
- &mdash;
1371
- <div class='inline'><p>
1372
- list of blocking users
1373
- </p>
1374
- </div>
1375
-
1376
- </li>
1377
-
1378
- </ul>
1379
-
1380
- </div><table class="source_code">
1381
- <tr>
1382
- <td>
1383
- <pre class="lines">
1384
-
1385
-
1386
- 35
1387
- 36
1388
- 37
1389
- 38
1390
- 39
1391
- 40
1392
- 41
1393
- 42
1394
- 43</pre>
1395
- </td>
1396
- <td>
1397
- <pre class="code"><span class="info file"># File 'lib/pupil/blocks.rb', line 35</span>
1398
-
1399
- <span class='kw'>def</span> <span class='id identifier rubyid_blocking'>blocking</span>
1400
- <span class='id identifier rubyid_response'>response</span> <span class='op'>=</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>/blocks/blocking.json</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
1401
- <span class='id identifier rubyid_users'>users</span> <span class='op'>=</span> <span class='const'>Array</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
1402
- <span class='id identifier rubyid_response'>response</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>users</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_element'>element</span><span class='op'>|</span>
1403
- <span class='id identifier rubyid_user'>user</span> <span class='op'>=</span> <span class='const'>User</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span> <span class='id identifier rubyid_element'>element</span>
1404
- <span class='id identifier rubyid_users'>users</span> <span class='op'>&lt;&lt;</span> <span class='id identifier rubyid_user'>user</span>
1405
- <span class='kw'>end</span>
1406
- <span class='kw'>return</span> <span class='id identifier rubyid_users'>users</span>
1407
- <span class='kw'>end</span></pre>
1408
- </td>
1409
- </tr>
1410
- </table>
1411
- </div>
1412
-
1413
- <div class="method_details ">
1414
- <p class="signature " id="destroy-instance_method">
1415
-
1416
- - (<tt>Object</tt>) <strong>destroy</strong>(status_id)
1417
-
1418
-
1419
-
1420
- </p><table class="source_code">
1421
- <tr>
1422
- <td>
1423
- <pre class="lines">
1424
-
1425
-
1426
- 80
1427
- 81
1428
- 82
1429
- 83</pre>
1430
- </td>
1431
- <td>
1432
- <pre class="code"><span class="info file"># File 'lib/pupil/statuses.rb', line 80</span>
1433
-
1434
- <span class='kw'>def</span> <span class='id identifier rubyid_destroy'>destroy</span> <span class='id identifier rubyid_status_id'>status_id</span>
1435
- <span class='id identifier rubyid_response'>response</span> <span class='op'>=</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>/statuses/destroy/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_status_id'>status_id</span><span class='rbrace'>}</span><span class='tstring_content'>.json</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
1436
- <span class='kw'>return</span> <span class='id identifier rubyid_response'>response</span>
1437
- <span class='kw'>end</span></pre>
1438
- </td>
1439
- </tr>
1440
- </table>
1441
- </div>
1442
-
1443
- <div class="method_details ">
1444
- <p class="signature " id="dm-instance_method">
1445
-
1446
- - (<tt>Hash</tt>) <strong>dm</strong>(param = {})
1447
-
1448
-
1449
-
1450
- </p><div class="docstring">
1451
- <div class="discussion">
1452
- <p>
1453
- Returning direct messages
1454
- </p>
1455
-
1456
-
1457
- </div>
1458
- </div>
1459
- <div class="tags">
1460
- <h3>Parameters:</h3>
1461
- <ul class="param">
1462
-
1463
- <li>
1464
-
1465
- <span class='name'>param</span>
1466
-
1467
-
1468
- <span class='type'>(<tt>Hash</tt>)</span>
1469
-
1470
-
1471
- <em class="default">(defaults to: <tt>{}</tt>)</em>
1472
-
1473
-
1474
- </li>
1475
-
1476
- </ul>
1477
-
1478
- <h3>Returns:</h3>
1479
- <ul class="return">
1480
-
1481
- <li>
1482
-
1483
-
1484
- <span class='type'>(<tt>Hash</tt>)</span>
1485
-
1486
-
1487
-
1488
- &mdash;
1489
- <div class='inline'><p>
1490
- directmessages
1491
- </p>
1492
- </div>
1493
-
1494
- </li>
1495
-
1496
- </ul>
1497
-
1498
- </div><table class="source_code">
1499
- <tr>
1500
- <td>
1501
- <pre class="lines">
1502
-
1503
-
1504
- 5
1505
- 6
1506
- 7
1507
- 8
1508
- 9
1509
- 10
1510
- 11
1511
- 12
1512
- 13
1513
- 14
1514
- 15
1515
- 16
1516
- 17
1517
- 18
1518
- 19
1519
- 20
1520
- 21
1521
- 22</pre>
1522
- </td>
1523
- <td>
1524
- <pre class="code"><span class="info file"># File 'lib/pupil/direct_messages.rb', line 5</span>
1525
-
1526
- <span class='kw'>def</span> <span class='id identifier rubyid_dm'>dm</span><span class='lparen'>(</span><span class='id identifier rubyid_param'>param</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
1527
- <span class='id identifier rubyid_param_s'>param_s</span> <span class='op'>=</span> <span class='id identifier rubyid_param_serializer'>param_serializer</span><span class='lparen'>(</span><span class='id identifier rubyid_param'>param</span><span class='rparen'>)</span>
1528
- <span class='kw'>begin</span>
1529
- <span class='id identifier rubyid_response'>response</span> <span class='op'>=</span> <span class='ivar'>@access_token</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>http://api.twitter.com/1/direct_messages.xml</span><span class='tstring_end'>&quot;</span></span><span class='op'>+</span><span class='id identifier rubyid_param_s'>param_s</span><span class='rparen'>)</span>
1530
- <span class='kw'>rescue</span>
1531
- <span class='kw'>return</span> <span class='kw'>false</span>
1532
- <span class='kw'>end</span>
1533
- <span class='id identifier rubyid_doc'>doc</span> <span class='op'>=</span> <span class='const'>REXML</span><span class='op'>::</span><span class='const'>Document</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_response'>response</span><span class='period'>.</span><span class='id identifier rubyid_body'>body</span><span class='rparen'>)</span>
1534
- <span class='kw'>return</span> <span class='kw'>false</span> <span class='kw'>if</span> <span class='id identifier rubyid_doc'>doc</span><span class='period'>.</span><span class='id identifier rubyid_is_error?'>is_error?</span>
1535
- <span class='id identifier rubyid_directmessages'>directmessages</span> <span class='op'>=</span> <span class='const'>Array</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
1536
-
1537
- <span class='id identifier rubyid_doc'>doc</span><span class='period'>.</span><span class='id identifier rubyid_get_elements'>get_elements</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>/direct-messages/direct_message</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span><span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_element'>element</span><span class='op'>|</span>
1538
- <span class='id identifier rubyid_dm'>dm</span> <span class='op'>=</span> <span class='const'>DirectMessage</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_element'>element</span><span class='rparen'>)</span>
1539
- <span class='id identifier rubyid_directmessages'>directmessages</span> <span class='op'>&lt;&lt;</span> <span class='id identifier rubyid_dm'>dm</span>
1540
- <span class='rbrace'>}</span>
1541
-
1542
- <span class='kw'>return</span> <span class='id identifier rubyid_directmessages'>directmessages</span>
1543
- <span class='kw'>end</span></pre>
1544
- </td>
1545
- </tr>
1546
- </table>
1547
- </div>
1548
-
1549
- <div class="method_details ">
1550
- <p class="signature " id="dm_destroy-instance_method">
1551
-
1552
- - (<tt>Hash</tt>) <strong>dm_destroy</strong>(dm_id)
1553
-
1554
-
1555
-
1556
- </p><div class="docstring">
1557
- <div class="discussion">
1558
- <p>
1559
- Delete direct message
1560
- </p>
1561
-
1562
-
1563
- </div>
1564
- </div>
1565
- <div class="tags">
1566
- <h3>Parameters:</h3>
1567
- <ul class="param">
1568
-
1569
- <li>
1570
-
1571
- <span class='name'>dm_id</span>
1572
-
1573
-
1574
- <span class='type'>(<tt>Fixnum</tt>)</span>
1575
-
1576
-
1577
-
1578
- &mdash;
1579
- <div class='inline'><p>
1580
- message id that you want to delete
1581
- </p>
1582
- </div>
1583
-
1584
- </li>
1585
-
1586
- </ul>
1587
-
1588
- <h3>Returns:</h3>
1589
- <ul class="return">
1590
-
1591
- <li>
1592
-
1593
-
1594
- <span class='type'>(<tt>Hash</tt>)</span>
1595
-
1596
-
1597
-
1598
- &mdash;
1599
- <div class='inline'><p>
1600
- response
1601
- </p>
1602
- </div>
1603
-
1604
- </li>
1605
-
1606
- </ul>
1607
-
1608
- </div><table class="source_code">
1609
- <tr>
1610
- <td>
1611
- <pre class="lines">
1612
-
1613
-
1614
- 49
1615
- 50
1616
- 51
1617
- 52
1618
- 53
1619
- 54
1620
- 55
1621
- 56</pre>
1622
- </td>
1623
- <td>
1624
- <pre class="code"><span class="info file"># File 'lib/pupil/direct_messages.rb', line 49</span>
1625
-
1626
- <span class='kw'>def</span> <span class='id identifier rubyid_dm_destroy'>dm_destroy</span><span class='lparen'>(</span><span class='id identifier rubyid_dm_id'>dm_id</span><span class='rparen'>)</span>
1627
- <span class='kw'>begin</span>
1628
- <span class='id identifier rubyid_response'>response</span> <span class='op'>=</span> <span class='ivar'>@access_token</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>http://api.twitter.com/1/direct_messages/destroy/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_dm_id'>dm_id</span><span class='rbrace'>}</span><span class='tstring_content'>.xml</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
1629
- <span class='kw'>rescue</span>
1630
- <span class='kw'>return</span> <span class='kw'>false</span>
1631
- <span class='kw'>end</span>
1632
- <span class='kw'>return</span> <span class='id identifier rubyid_response'>response</span>
1633
- <span class='kw'>end</span></pre>
1634
- </td>
1635
- </tr>
1636
- </table>
1637
- </div>
1638
-
1639
- <div class="method_details ">
1640
- <p class="signature " id="dm_sent-instance_method">
1641
-
1642
- - (<tt>Hash</tt>) <strong>dm_sent</strong>(param = {})
1643
-
1644
-
1645
-
1646
- </p><div class="docstring">
1647
- <div class="discussion">
1648
- <p>
1649
- Returning direct messages you sent
1650
- </p>
1651
-
1652
-
1653
- </div>
1654
- </div>
1655
- <div class="tags">
1656
- <h3>Parameters:</h3>
1657
- <ul class="param">
1658
-
1659
- <li>
1660
-
1661
- <span class='name'>param</span>
1662
-
1663
-
1664
- <span class='type'>(<tt>Hash</tt>)</span>
1665
-
1666
-
1667
- <em class="default">(defaults to: <tt>{}</tt>)</em>
1668
-
1669
-
1670
- </li>
1671
-
1672
- </ul>
1673
-
1674
- <h3>Returns:</h3>
1675
- <ul class="return">
1676
-
1677
- <li>
1678
-
1679
-
1680
- <span class='type'>(<tt>Hash</tt>)</span>
1681
-
1682
-
1683
-
1684
- &mdash;
1685
- <div class='inline'><p>
1686
- directmessage you sent
1687
- </p>
1688
- </div>
1689
-
1690
- </li>
1691
-
1692
- </ul>
1693
-
1694
- </div><table class="source_code">
1695
- <tr>
1696
- <td>
1697
- <pre class="lines">
1698
-
1699
-
1700
- 27
1701
- 28
1702
- 29
1703
- 30
1704
- 31
1705
- 32
1706
- 33
1707
- 34
1708
- 35
1709
- 36
1710
- 37
1711
- 38
1712
- 39
1713
- 40
1714
- 41
1715
- 42
1716
- 43
1717
- 44</pre>
1718
- </td>
1719
- <td>
1720
- <pre class="code"><span class="info file"># File 'lib/pupil/direct_messages.rb', line 27</span>
1721
-
1722
- <span class='kw'>def</span> <span class='id identifier rubyid_dm_sent'>dm_sent</span><span class='lparen'>(</span><span class='id identifier rubyid_param'>param</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
1723
- <span class='id identifier rubyid_param_s'>param_s</span> <span class='op'>=</span> <span class='id identifier rubyid_param_serializer'>param_serializer</span><span class='lparen'>(</span><span class='id identifier rubyid_param'>param</span><span class='rparen'>)</span>
1724
- <span class='kw'>begin</span>
1725
- <span class='id identifier rubyid_response'>response</span> <span class='op'>=</span> <span class='ivar'>@access_token</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>http://api.twitter.com/1/direct_messages/sent.xml</span><span class='tstring_end'>&quot;</span></span><span class='op'>+</span><span class='id identifier rubyid_param_s'>param_s</span><span class='rparen'>)</span>
1726
- <span class='kw'>rescue</span>
1727
- <span class='kw'>return</span> <span class='kw'>false</span>
1728
- <span class='kw'>end</span>
1729
- <span class='id identifier rubyid_doc'>doc</span> <span class='op'>=</span> <span class='const'>REXML</span><span class='op'>::</span><span class='const'>Document</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_response'>response</span><span class='period'>.</span><span class='id identifier rubyid_body'>body</span><span class='rparen'>)</span>
1730
- <span class='kw'>return</span> <span class='kw'>false</span> <span class='kw'>if</span> <span class='id identifier rubyid_doc'>doc</span><span class='period'>.</span><span class='id identifier rubyid_is_error?'>is_error?</span>
1731
- <span class='id identifier rubyid_directmessages'>directmessages</span> <span class='op'>=</span> <span class='const'>Array</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
1732
-
1733
- <span class='id identifier rubyid_doc'>doc</span><span class='period'>.</span><span class='id identifier rubyid_get_elements'>get_elements</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>/direct-messages/direct_message</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span><span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_element'>element</span><span class='op'>|</span>
1734
- <span class='id identifier rubyid_dm'>dm</span> <span class='op'>=</span> <span class='const'>DirectMessage</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_element'>element</span><span class='rparen'>)</span>
1735
- <span class='id identifier rubyid_directmessages'>directmessages</span> <span class='op'>&lt;&lt;</span> <span class='id identifier rubyid_dm'>dm</span>
1736
- <span class='rbrace'>}</span>
1737
-
1738
- <span class='kw'>return</span> <span class='id identifier rubyid_directmessages'>directmessages</span>
1739
- <span class='kw'>end</span></pre>
1740
- </td>
1741
- </tr>
1742
- </table>
1743
- </div>
1744
-
1745
- <div class="method_details ">
1746
- <p class="signature " id="end_session-instance_method">
1747
-
1748
- - (<tt>Hash</tt>) <strong>end_session</strong>
1749
-
1750
-
1751
-
1752
- </p><div class="docstring">
1753
- <div class="discussion">
1754
- <p>
1755
- End oauth session
1756
- </p>
1757
-
1758
-
1759
- </div>
1760
- </div>
1761
- <div class="tags">
1762
-
1763
- <h3>Returns:</h3>
1764
- <ul class="return">
1765
-
1766
- <li>
1767
-
1768
-
1769
- <span class='type'>(<tt>Hash</tt>)</span>
1770
-
1771
-
1772
-
1773
- &mdash;
1774
- <div class='inline'><p>
1775
- Result
1776
- </p>
1777
- </div>
1778
-
1779
- </li>
1780
-
1781
- </ul>
1782
-
1783
- </div><table class="source_code">
1784
- <tr>
1785
- <td>
1786
- <pre class="lines">
1787
-
1788
-
1789
- 19
1790
- 20
1791
- 21
1792
- 22</pre>
1793
- </td>
1794
- <td>
1795
- <pre class="code"><span class="info file"># File 'lib/pupil/account.rb', line 19</span>
1796
-
1797
- <span class='kw'>def</span> <span class='id identifier rubyid_end_session'>end_session</span>
1798
- <span class='id identifier rubyid_response'>response</span> <span class='op'>=</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>/account/end_session.json</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
1799
- <span class='kw'>return</span> <span class='id identifier rubyid_response'>response</span>
1800
- <span class='kw'>end</span></pre>
1801
- </td>
1802
- </tr>
1803
- </table>
1804
- </div>
1805
-
1806
- <div class="method_details ">
1807
- <p class="signature " id="follow-instance_method">
1808
-
1809
- - (<tt>Hash</tt>) <strong>follow</strong>(param)
1810
-
1811
-
1812
-
1813
- </p><div class="docstring">
1814
- <div class="discussion">
1815
- <p>
1816
- Follow user for screen_name
1817
- </p>
1818
-
1819
-
1820
- </div>
1821
- </div>
1822
- <div class="tags">
1823
- <h3>Parameters:</h3>
1824
- <ul class="param">
1825
-
1826
- <li>
1827
-
1828
- <span class='name'>name</span>
1829
-
1830
-
1831
- <span class='type'>(<tt>String</tt>)</span>
1832
-
1833
-
1834
-
1835
- &mdash;
1836
- <div class='inline'><p>
1837
- screen_name
1838
- </p>
1839
- </div>
1840
-
1841
- </li>
1842
-
1843
- </ul>
1844
-
1845
- <h3>Returns:</h3>
1846
- <ul class="return">
1847
-
1848
- <li>
1849
-
1850
-
1851
- <span class='type'>(<tt>Hash</tt>)</span>
1852
-
1853
-
1854
-
1855
- &mdash;
1856
- <div class='inline'><p>
1857
- response
1858
- </p>
1859
- </div>
1860
-
1861
- </li>
1862
-
1863
- </ul>
1864
-
1865
- </div><table class="source_code">
1866
- <tr>
1867
- <td>
1868
- <pre class="lines">
1869
-
1870
-
1871
- 40
1872
- 41
1873
- 42
1874
- 43
1875
- 44
1876
- 45
1877
- 46
1878
- 47
1879
- 48
1880
- 49
1881
- 50
1882
- 51
1883
- 52</pre>
1884
- </td>
1885
- <td>
1886
- <pre class="code"><span class="info file"># File 'lib/pupil/friendships.rb', line 40</span>
1887
-
1888
- <span class='kw'>def</span> <span class='id identifier rubyid_follow'>follow</span> <span class='id identifier rubyid_param'>param</span>
1889
- <span class='kw'>case</span> <span class='id identifier rubyid_param'>param</span><span class='period'>.</span><span class='id identifier rubyid_keys'>keys</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_to_sym'>to_sym</span>
1890
- <span class='kw'>when</span> <span class='symbol'>:screen_name</span>
1891
- <span class='id identifier rubyid_response'>response</span> <span class='op'>=</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>/friendships/create.json</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='lbrace'>{</span><span class='symbol'>:screen_name</span> <span class='op'>=&gt;</span> <span class='id identifier rubyid_param'>param</span><span class='period'>.</span><span class='id identifier rubyid_values'>values</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span><span class='rbrace'>}</span><span class='rparen'>)</span>
1892
- <span class='kw'>when</span> <span class='symbol'>:id</span>
1893
- <span class='id identifier rubyid_response'>response</span> <span class='op'>=</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>/friendships/create.json</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='lbrace'>{</span><span class='symbol'>:user_id</span> <span class='op'>=&gt;</span> <span class='id identifier rubyid_param'>param</span><span class='period'>.</span><span class='id identifier rubyid_values'>values</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span><span class='rbrace'>}</span><span class='rparen'>)</span>
1894
- <span class='kw'>end</span>
1895
-
1896
- <span class='kw'>if</span> <span class='id identifier rubyid_response'>response</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span> <span class='op'>==</span> <span class='const'>Hash</span> <span class='op'>&amp;&amp;</span> <span class='id identifier rubyid_response'>response</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>id</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span>
1897
- <span class='kw'>return</span> <span class='const'>User</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span> <span class='id identifier rubyid_response'>response</span>
1898
- <span class='kw'>end</span>
1899
- <span class='kw'>return</span> <span class='kw'>false</span>
1900
- <span class='kw'>end</span></pre>
1901
- </td>
1902
- </tr>
1903
- </table>
1904
- </div>
1905
-
1906
- <div class="method_details ">
1907
- <p class="signature " id="followers_ids-instance_method">
1908
-
1909
- - (<tt>Object</tt>) <strong>followers_ids</strong>(name = @screen_name)
1910
-
1911
-
1912
-
1913
- </p><table class="source_code">
1914
- <tr>
1915
- <td>
1916
- <pre class="lines">
1917
-
1918
-
1919
- 11
1920
- 12
1921
- 13
1922
- 14
1923
- 15
1924
- 16
1925
- 17
1926
- 18</pre>
1927
- </td>
1928
- <td>
1929
- <pre class="code"><span class="info file"># File 'lib/pupil/friendships.rb', line 11</span>
1930
-
1931
- <span class='kw'>def</span> <span class='id identifier rubyid_followers_ids'>followers_ids</span> <span class='id identifier rubyid_name'>name</span><span class='op'>=</span><span class='ivar'>@screen_name</span>
1932
- <span class='id identifier rubyid_response'>response</span> <span class='op'>=</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>/1/followers/ids/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_name'>name</span><span class='rbrace'>}</span><span class='tstring_content'>.json</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
1933
- <span class='id identifier rubyid_ids'>ids</span> <span class='op'>=</span> <span class='const'>Array</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
1934
- <span class='id identifier rubyid_response'>response</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_element'>element</span><span class='op'>|</span>
1935
- <span class='id identifier rubyid_ids'>ids</span> <span class='op'>&lt;&lt;</span> <span class='id identifier rubyid_element'>element</span>
1936
- <span class='kw'>end</span>
1937
- <span class='kw'>return</span> <span class='id identifier rubyid_ids'>ids</span>
1938
- <span class='kw'>end</span></pre>
1939
- </td>
1940
- </tr>
1941
- </table>
1942
- </div>
1943
-
1944
- <div class="method_details ">
1945
- <p class="signature " id="friends_ids-instance_method">
1946
-
1947
- - (<tt>Object</tt>) <strong>friends_ids</strong>(name)
1948
-
1949
-
1950
-
1951
- </p><table class="source_code">
1952
- <tr>
1953
- <td>
1954
- <pre class="lines">
1955
-
1956
-
1957
- 2
1958
- 3
1959
- 4
1960
- 5
1961
- 6
1962
- 7
1963
- 8
1964
- 9</pre>
1965
- </td>
1966
- <td>
1967
- <pre class="code"><span class="info file"># File 'lib/pupil/friendships.rb', line 2</span>
1968
-
1969
- <span class='kw'>def</span> <span class='id identifier rubyid_friends_ids'>friends_ids</span> <span class='id identifier rubyid_name'>name</span>
1970
- <span class='id identifier rubyid_response'>response</span> <span class='op'>=</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>/friends/ids/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_name'>name</span><span class='rbrace'>}</span><span class='tstring_content'>.json</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
1971
- <span class='id identifier rubyid_ids'>ids</span> <span class='op'>=</span> <span class='const'>Array</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
1972
- <span class='id identifier rubyid_response'>response</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_element'>element</span><span class='op'>|</span>
1973
- <span class='id identifier rubyid_ids'>ids</span> <span class='op'>&lt;&lt;</span> <span class='id identifier rubyid_element'>element</span>
1974
- <span class='kw'>end</span>
1975
- <span class='kw'>return</span> <span class='id identifier rubyid_ids'>ids</span>
1976
- <span class='kw'>end</span></pre>
1977
- </td>
1978
- </tr>
1979
- </table>
1980
- </div>
1981
-
1982
- <div class="method_details ">
1983
- <p class="signature " id="friendship?-instance_method">
1984
-
1985
- - (<tt>Boolean</tt>) <strong>friendship?</strong>(src, dst)
1986
-
1987
-
1988
-
1989
- <span class="aliases">Also known as:
1990
- <span class="names"><span id='relationship?-instance_method'>relationship?</span>, <span id='friendships_exists?-instance_method'>friendships_exists?</span></span>
1991
- </span>
1992
-
1993
- </p><div class="docstring">
1994
- <div class="discussion">
1995
- <p>
1996
- Check friendships
1997
- </p>
1998
-
1999
-
2000
- </div>
2001
- </div>
2002
- <div class="tags">
2003
- <h3>Parameters:</h3>
2004
- <ul class="param">
2005
-
2006
- <li>
2007
-
2008
- <span class='name'>src</span>
2009
-
2010
-
2011
- <span class='type'>(<tt>String</tt>)</span>
2012
-
2013
-
2014
-
2015
- &mdash;
2016
- <div class='inline'><p>
2017
- source screen_name
2018
- </p>
2019
- </div>
2020
-
2021
- </li>
2022
-
2023
- <li>
2024
-
2025
- <span class='name'>dst</span>
2026
-
2027
-
2028
- <span class='type'>(<tt>String</tt>)</span>
2029
-
2030
-
2031
-
2032
- &mdash;
2033
- <div class='inline'><p>
2034
- destination screen_name
2035
- </p>
2036
- </div>
2037
-
2038
- </li>
2039
-
2040
- </ul>
2041
-
2042
- <h3>Returns:</h3>
2043
- <ul class="return">
2044
-
2045
- <li>
2046
-
2047
-
2048
- <span class='type'>(<tt>Boolean</tt>)</span>
2049
-
2050
-
2051
-
2052
- &mdash;
2053
- <div class='inline'><p>
2054
- return true if paired users have friendship, or ruturn false
2055
- </p>
2056
- </div>
2057
-
2058
- </li>
2059
-
2060
- </ul>
2061
-
2062
- </div><table class="source_code">
2063
- <tr>
2064
- <td>
2065
- <pre class="lines">
2066
-
2067
-
2068
- 24
2069
- 25
2070
- 26
2071
- 27
2072
- 28
2073
- 29
2074
- 30
2075
- 31
2076
- 32</pre>
2077
- </td>
2078
- <td>
2079
- <pre class="code"><span class="info file"># File 'lib/pupil/friendships.rb', line 24</span>
2080
-
2081
- <span class='kw'>def</span> <span class='id identifier rubyid_friendship?'>friendship?</span><span class='lparen'>(</span><span class='id identifier rubyid_src'>src</span><span class='comma'>,</span> <span class='id identifier rubyid_dst'>dst</span><span class='rparen'>)</span>
2082
- <span class='id identifier rubyid_param'>param</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='symbol'>:source_screen_name</span> <span class='op'>=&gt;</span> <span class='id identifier rubyid_src'>src</span><span class='comma'>,</span> <span class='symbol'>:target_screen_name</span> <span class='op'>=&gt;</span> <span class='id identifier rubyid_dst'>dst</span><span class='rbrace'>}</span>
2083
- <span class='id identifier rubyid_response'>response</span> <span class='op'>=</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>/friendships/show.json</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='id identifier rubyid_param'>param</span><span class='rparen'>)</span>
2084
- <span class='kw'>if</span> <span class='id identifier rubyid_response'>response</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>relationship</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>source</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>following</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span> <span class='op'>==</span> <span class='kw'>true</span> <span class='op'>&amp;&amp;</span> <span class='id identifier rubyid_response'>response</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>relationship</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>target</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>following</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span> <span class='op'>==</span> <span class='kw'>true</span> <span class='kw'>then</span>
2085
- <span class='kw'>return</span> <span class='kw'>true</span>
2086
- <span class='kw'>else</span>
2087
- <span class='kw'>return</span> <span class='kw'>false</span>
2088
- <span class='kw'>end</span>
2089
- <span class='kw'>end</span></pre>
2090
- </td>
2091
- </tr>
2092
- </table>
2093
- </div>
2094
-
2095
- <div class="method_details ">
2096
- <p class="signature " id="get-instance_method">
2097
-
2098
- - (<tt>Object</tt>) <strong>get</strong>(url, param = {})
2099
-
2100
-
2101
-
2102
- </p><table class="source_code">
2103
- <tr>
2104
- <td>
2105
- <pre class="lines">
2106
-
2107
-
2108
- 68
2109
- 69
2110
- 70
2111
- 71
2112
- 72
2113
- 73
2114
- 74
2115
- 75
2116
- 76</pre>
2117
- </td>
2118
- <td>
2119
- <pre class="code"><span class="info file"># File 'lib/pupil/base.rb', line 68</span>
2120
-
2121
- <span class='kw'>def</span> <span class='id identifier rubyid_get'>get</span> <span class='id identifier rubyid_url'>url</span><span class='comma'>,</span> <span class='id identifier rubyid_param'>param</span><span class='op'>=</span><span class='lbrace'>{</span><span class='rbrace'>}</span>
2122
- <span class='id identifier rubyid_param_s'>param_s</span> <span class='op'>=</span> <span class='id identifier rubyid_param_serializer'>param_serializer</span><span class='lparen'>(</span><span class='id identifier rubyid_param'>param</span><span class='rparen'>)</span>
2123
- <span class='kw'>begin</span>
2124
- <span class='id identifier rubyid_response'>response</span> <span class='op'>=</span> <span class='ivar'>@access_token</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='id identifier rubyid_url'>url</span><span class='op'>+</span><span class='id identifier rubyid_param_s'>param_s</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_body'>body</span>
2125
- <span class='kw'>rescue</span> <span class='op'>=&gt;</span> <span class='id identifier rubyid_vars'>vars</span>
2126
- <span class='id identifier rubyid_raise'>raise</span> <span class='const'>NetworkError</span><span class='comma'>,</span> <span class='id identifier rubyid_vars'>vars</span>
2127
- <span class='kw'>end</span>
2128
- <span class='kw'>return</span> <span class='const'>JSON</span><span class='period'>.</span><span class='id identifier rubyid_parse'>parse</span><span class='lparen'>(</span><span class='id identifier rubyid_response'>response</span><span class='rparen'>)</span>
2129
- <span class='kw'>end</span></pre>
2130
- </td>
2131
- </tr>
2132
- </table>
2133
- </div>
2134
-
2135
- <div class="method_details ">
2136
- <p class="signature " id="home_timeline-instance_method">
2137
-
2138
- - (<tt>Array</tt>) <strong>home_timeline</strong>(param = {})
2139
-
2140
-
2141
-
2142
- </p><div class="docstring">
2143
- <div class="discussion">
2144
- <p>
2145
- Timeline
2146
- </p>
2147
-
2148
-
2149
- </div>
2150
- </div>
2151
- <div class="tags">
2152
- <h3>Parameters:</h3>
2153
- <ul class="param">
2154
-
2155
- <li>
2156
-
2157
- <span class='name'>param</span>
2158
-
2159
-
2160
- <span class='type'>(<tt>Hash</tt>)</span>
2161
-
2162
-
2163
- <em class="default">(defaults to: <tt>{}</tt>)</em>
2164
-
2165
-
2166
- </li>
2167
-
2168
- </ul>
2169
-
2170
-
2171
-
2172
-
2173
- <h3>Options Hash (<tt>param</tt>):</h3>
2174
- <ul class="option">
2175
-
2176
- <li>
2177
- <span class="name">:count</span>
2178
- <span class="type">(<tt>Fixnum</tt>)</span>
2179
- <span class="default">
2180
-
2181
- </span>
2182
- &mdash; <div class='inline'><p>
2183
- Number of tweets
2184
- </p>
2185
- </div>
2186
- </li>
2187
-
2188
- <li>
2189
- <span class="name">:since_id</span>
2190
- <span class="type">(<tt>Fixnum</tt>)</span>
2191
- <span class="default">
2192
-
2193
- </span>
2194
-
2195
- </li>
2196
-
2197
- <li>
2198
- <span class="name">:max_id</span>
2199
- <span class="type">(<tt>Fixnum</tt>)</span>
2200
- <span class="default">
2201
-
2202
- </span>
2203
-
2204
- </li>
2205
-
2206
- <li>
2207
- <span class="name">:page</span>
2208
- <span class="type">(<tt>Fixnum</tt>)</span>
2209
- <span class="default">
2210
-
2211
- </span>
2212
-
2213
- </li>
2214
-
2215
- <li>
2216
- <span class="name">:trim_user</span>
2217
- <span class="type">(<tt>Symbol</tt>)</span>
2218
- <span class="default">
2219
-
2220
- </span>
2221
-
2222
- </li>
2223
-
2224
- <li>
2225
- <span class="name">:include</span>
2226
- <span class="type">(<tt>Symbol</tt>)</span>
2227
- <span class="default">
2228
-
2229
- </span>
2230
- &mdash; <div class='inline'><p>
2231
- #=> [:rts]
2232
- </p>
2233
- </div>
2234
- </li>
2235
-
2236
- <li>
2237
- <span class="name">:exclude</span>
2238
- <span class="type">(<tt>Symbol</tt>)</span>
2239
- <span class="default">
2240
-
2241
- </span>
2242
- &mdash; <div class='inline'><p>
2243
- #=> [:replies]
2244
- </p>
2245
- </div>
2246
- </li>
2247
-
2248
- <li>
2249
- <span class="name">:contributor_details</span>
2250
- <span class="type">(<tt>Symbol</tt>)</span>
2251
- <span class="default">
2252
-
2253
- </span>
2254
-
2255
- </li>
2256
-
2257
- </ul>
2258
-
2259
-
2260
- <h3>Returns:</h3>
2261
- <ul class="return">
2262
-
2263
- <li>
2264
-
2265
-
2266
- <span class='type'>(<tt>Array</tt>)</span>
2267
-
2268
-
2269
-
2270
- &mdash;
2271
- <div class='inline'><p>
2272
- Timeline
2273
- </p>
2274
- </div>
2275
-
2276
- </li>
2277
-
2278
- </ul>
2279
-
2280
- </div><table class="source_code">
2281
- <tr>
2282
- <td>
2283
- <pre class="lines">
2284
-
2285
-
2286
- 12
2287
- 13
2288
- 14
2289
- 15
2290
- 16
2291
- 17
2292
- 18
2293
- 19
2294
- 20</pre>
2295
- </td>
2296
- <td>
2297
- <pre class="code"><span class="info file"># File 'lib/pupil/statuses.rb', line 12</span>
2298
-
2299
- <span class='kw'>def</span> <span class='id identifier rubyid_home_timeline'>home_timeline</span> <span class='id identifier rubyid_param'>param</span><span class='op'>=</span><span class='lbrace'>{</span><span class='rbrace'>}</span>
2300
- <span class='id identifier rubyid_response'>response</span> <span class='op'>=</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>/statuses/home_timeline.json</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='id identifier rubyid_param'>param</span><span class='rparen'>)</span>
2301
- <span class='id identifier rubyid_statuses'>statuses</span> <span class='op'>=</span> <span class='const'>Array</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
2302
- <span class='id identifier rubyid_response'>response</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_element'>element</span><span class='op'>|</span>
2303
- <span class='id identifier rubyid_status'>status</span> <span class='op'>=</span> <span class='const'>Status</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span> <span class='id identifier rubyid_element'>element</span>
2304
- <span class='id identifier rubyid_statuses'>statuses</span> <span class='op'>&lt;&lt;</span> <span class='id identifier rubyid_status'>status</span>
2305
- <span class='kw'>end</span>
2306
- <span class='kw'>return</span> <span class='id identifier rubyid_statuses'>statuses</span>
2307
- <span class='kw'>end</span></pre>
2308
- </td>
2309
- </tr>
2310
- </table>
2311
- </div>
2312
-
2313
- <div class="method_details ">
2314
- <p class="signature " id="lists-instance_method">
2315
-
2316
- - (<tt>Hash</tt>) <strong>lists</strong>
2317
-
2318
-
2319
-
2320
- </p><div class="docstring">
2321
- <div class="discussion">
2322
- <p>
2323
- Lists
2324
- </p>
2325
-
2326
-
2327
- </div>
2328
- </div>
2329
- <div class="tags">
2330
-
2331
- <h3>Returns:</h3>
2332
- <ul class="return">
2333
-
2334
- <li>
2335
-
2336
-
2337
- <span class='type'>(<tt>Hash</tt>)</span>
2338
-
2339
-
2340
-
2341
- &mdash;
2342
- <div class='inline'><p>
2343
- lists
2344
- </p>
2345
- </div>
2346
-
2347
- </li>
2348
-
2349
- </ul>
2350
-
2351
- </div><table class="source_code">
2352
- <tr>
2353
- <td>
2354
- <pre class="lines">
2355
-
2356
-
2357
- 11
2358
- 12
2359
- 13
2360
- 14
2361
- 15
2362
- 16
2363
- 17
2364
- 18
2365
- 19
2366
- 20
2367
- 21</pre>
2368
- </td>
2369
- <td>
2370
- <pre class="code"><span class="info file"># File 'lib/pupil/lists.rb', line 11</span>
2371
-
2372
- <span class='kw'>def</span> <span class='id identifier rubyid_lists'>lists</span>
2373
- <span class='id identifier rubyid_response'>response</span> <span class='op'>=</span> <span class='ivar'>@access_token</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>http://api.twitter.com/1/</span><span class='embexpr_beg'>#{</span><span class='ivar'>@username</span><span class='rbrace'>}</span><span class='tstring_content'>/lists.xml</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
2374
- <span class='id identifier rubyid_doc'>doc</span> <span class='op'>=</span> <span class='const'>REXML</span><span class='op'>::</span><span class='const'>Document</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_response'>response</span><span class='period'>.</span><span class='id identifier rubyid_body'>body</span><span class='rparen'>)</span>
2375
- <span class='kw'>return</span> <span class='kw'>false</span> <span class='kw'>if</span> <span class='id identifier rubyid_doc'>doc</span><span class='period'>.</span><span class='id identifier rubyid_is_error?'>is_error?</span>
2376
- <span class='id identifier rubyid_lists'>lists</span> <span class='op'>=</span> <span class='const'>Array</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
2377
- <span class='id identifier rubyid_doc'>doc</span><span class='period'>.</span><span class='id identifier rubyid_get_elements'>get_elements</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>/lists_list/lists/list</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span><span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_element'>element</span><span class='op'>|</span>
2378
- <span class='id identifier rubyid_list'>list</span> <span class='op'>=</span> <span class='const'>List</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_element'>element</span><span class='rparen'>)</span>
2379
- <span class='id identifier rubyid_lists'>lists</span> <span class='op'>&lt;&lt;</span> <span class='id identifier rubyid_list'>list</span>
2380
- <span class='rbrace'>}</span>
2381
- <span class='kw'>return</span> <span class='id identifier rubyid_lists'>lists</span>
2382
- <span class='kw'>end</span></pre>
2383
- </td>
2384
- </tr>
2385
- </table>
2386
- </div>
2387
-
2388
- <div class="method_details ">
2389
- <p class="signature " id="lists_member_create-instance_method">
2390
-
2391
- - (<tt>Object</tt>) <strong>lists_member_create</strong>(listid, id)
2392
-
2393
-
2394
-
2395
- </p><table class="source_code">
2396
- <tr>
2397
- <td>
2398
- <pre class="lines">
2399
-
2400
-
2401
- 23
2402
- 24
2403
- 25
2404
- 26
2405
- 27
2406
- 28
2407
- 29
2408
- 30
2409
- 31</pre>
2410
- </td>
2411
- <td>
2412
- <pre class="code"><span class="info file"># File 'lib/pupil/lists.rb', line 23</span>
2413
-
2414
- <span class='kw'>def</span> <span class='id identifier rubyid_lists_member_create'>lists_member_create</span><span class='lparen'>(</span><span class='id identifier rubyid_listid'>listid</span><span class='comma'>,</span><span class='id identifier rubyid_id'>id</span><span class='rparen'>)</span>
2415
- <span class='kw'>begin</span>
2416
- <span class='id identifier rubyid_response'>response</span> <span class='op'>=</span> <span class='ivar'>@access_token</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>http://api.twitter.com/1/</span><span class='embexpr_beg'>#{</span><span class='ivar'>@username</span><span class='rbrace'>}</span><span class='tstring_content'>/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_listid'>listid</span><span class='rbrace'>}</span><span class='tstring_content'>/members.xml?id=</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='rbrace'>}</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
2417
- <span class='kw'>rescue</span>
2418
- <span class='kw'>return</span> <span class='kw'>false</span>
2419
- <span class='kw'>else</span>
2420
- <span class='kw'>return</span> <span class='id identifier rubyid_response'>response</span>
2421
- <span class='kw'>end</span>
2422
- <span class='kw'>end</span></pre>
2423
- </td>
2424
- </tr>
2425
- </table>
2426
- </div>
2427
-
2428
- <div class="method_details ">
2429
- <p class="signature " id="lookup-instance_method">
2430
-
2431
- - (<tt>Object</tt>) <strong>lookup</strong>(param = {})
2432
-
2433
-
2434
-
2435
- </p><table class="source_code">
2436
- <tr>
2437
- <td>
2438
- <pre class="lines">
2439
-
2440
-
2441
- 2
2442
- 3
2443
- 4
2444
- 5
2445
- 6
2446
- 7
2447
- 8
2448
- 9
2449
- 10</pre>
2450
- </td>
2451
- <td>
2452
- <pre class="code"><span class="info file"># File 'lib/pupil/users.rb', line 2</span>
2453
-
2454
- <span class='kw'>def</span> <span class='id identifier rubyid_lookup'>lookup</span> <span class='id identifier rubyid_param'>param</span><span class='op'>=</span><span class='lbrace'>{</span><span class='rbrace'>}</span>
2455
- <span class='id identifier rubyid_response'>response</span> <span class='op'>=</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>/users/lookup.json</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='id identifier rubyid_param'>param</span><span class='rparen'>)</span>
2456
- <span class='id identifier rubyid_users'>users</span> <span class='op'>=</span> <span class='const'>Array</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
2457
- <span class='id identifier rubyid_response'>response</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_element'>element</span><span class='op'>|</span>
2458
- <span class='id identifier rubyid_user'>user</span> <span class='op'>=</span> <span class='const'>User</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span> <span class='id identifier rubyid_element'>element</span>
2459
- <span class='id identifier rubyid_users'>users</span> <span class='op'>&lt;&lt;</span> <span class='id identifier rubyid_user'>user</span>
2460
- <span class='kw'>end</span>
2461
- <span class='kw'>return</span> <span class='id identifier rubyid_users'>users</span>
2462
- <span class='kw'>end</span></pre>
2463
- </td>
2464
- </tr>
2465
- </table>
2466
- </div>
2467
-
2468
- <div class="method_details ">
2469
- <p class="signature " id="mentions-instance_method">
2470
-
2471
- - (<tt>Hash</tt>) <strong>mentions</strong>(param = {})
2472
-
2473
-
2474
-
2475
- </p><div class="docstring">
2476
- <div class="discussion">
2477
- <p>
2478
- Mention
2479
- </p>
2480
-
2481
-
2482
- </div>
2483
- </div>
2484
- <div class="tags">
2485
- <h3>Parameters:</h3>
2486
- <ul class="param">
2487
-
2488
- <li>
2489
-
2490
- <span class='name'>param</span>
2491
-
2492
-
2493
- <span class='type'>(<tt>Hash</tt>)</span>
2494
-
2495
-
2496
- <em class="default">(defaults to: <tt>{}</tt>)</em>
2497
-
2498
-
2499
- </li>
2500
-
2501
- </ul>
2502
-
2503
- <h3>Returns:</h3>
2504
- <ul class="return">
2505
-
2506
- <li>
2507
-
2508
-
2509
- <span class='type'>(<tt>Hash</tt>)</span>
2510
-
2511
-
2512
-
2513
- &mdash;
2514
- <div class='inline'><p>
2515
- mention
2516
- </p>
2517
- </div>
2518
-
2519
- </li>
2520
-
2521
- </ul>
2522
-
2523
- </div><table class="source_code">
2524
- <tr>
2525
- <td>
2526
- <pre class="lines">
2527
-
2528
-
2529
- 24
2530
- 25
2531
- 26
2532
- 27
2533
- 28
2534
- 29
2535
- 30
2536
- 31
2537
- 32</pre>
2538
- </td>
2539
- <td>
2540
- <pre class="code"><span class="info file"># File 'lib/pupil/statuses.rb', line 24</span>
2541
-
2542
- <span class='kw'>def</span> <span class='id identifier rubyid_mentions'>mentions</span> <span class='id identifier rubyid_param'>param</span><span class='op'>=</span><span class='lbrace'>{</span><span class='rbrace'>}</span>
2543
- <span class='id identifier rubyid_response'>response</span> <span class='op'>=</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>/statuses/mentions.json</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='id identifier rubyid_param'>param</span><span class='rparen'>)</span>
2544
- <span class='id identifier rubyid_statuses'>statuses</span> <span class='op'>=</span> <span class='const'>Array</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
2545
- <span class='id identifier rubyid_response'>response</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_element'>element</span><span class='op'>|</span>
2546
- <span class='id identifier rubyid_status'>status</span> <span class='op'>=</span> <span class='const'>Status</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span> <span class='id identifier rubyid_element'>element</span>
2547
- <span class='id identifier rubyid_statuses'>statuses</span> <span class='op'>&lt;&lt;</span> <span class='id identifier rubyid_status'>status</span>
2548
- <span class='kw'>end</span>
2549
- <span class='kw'>return</span> <span class='id identifier rubyid_statuses'>statuses</span>
2550
- <span class='kw'>end</span></pre>
2551
- </td>
2552
- </tr>
2553
- </table>
2554
- </div>
2555
-
2556
- <div class="method_details ">
2557
- <p class="signature " id="param_serializer-instance_method">
2558
-
2559
- - (<tt>Object</tt>) <strong>param_serializer</strong>(parameter)
2560
-
2561
-
2562
-
2563
- </p><table class="source_code">
2564
- <tr>
2565
- <td>
2566
- <pre class="lines">
2567
-
2568
-
2569
- 64
2570
- 65
2571
- 66</pre>
2572
- </td>
2573
- <td>
2574
- <pre class="code"><span class="info file"># File 'lib/pupil/base.rb', line 64</span>
2575
-
2576
- <span class='kw'>def</span> <span class='id identifier rubyid_param_serializer'>param_serializer</span> <span class='id identifier rubyid_parameter'>parameter</span>
2577
- <span class='const'>Pupil</span><span class='period'>.</span><span class='id identifier rubyid_param_serializer'>param_serializer</span> <span class='id identifier rubyid_parameter'>parameter</span>
2578
- <span class='kw'>end</span></pre>
2579
- </td>
2580
- </tr>
2581
- </table>
2582
- </div>
2583
-
2584
- <div class="method_details ">
2585
- <p class="signature " id="post-instance_method">
2586
-
2587
- - (<tt>Object</tt>) <strong>post</strong>(url, param = {})
2588
-
2589
-
2590
-
2591
- </p><table class="source_code">
2592
- <tr>
2593
- <td>
2594
- <pre class="lines">
2595
-
2596
-
2597
- 78
2598
- 79
2599
- 80
2600
- 81
2601
- 82
2602
- 83
2603
- 84
2604
- 85
2605
- 86</pre>
2606
- </td>
2607
- <td>
2608
- <pre class="code"><span class="info file"># File 'lib/pupil/base.rb', line 78</span>
2609
-
2610
- <span class='kw'>def</span> <span class='id identifier rubyid_post'>post</span> <span class='id identifier rubyid_url'>url</span><span class='comma'>,</span> <span class='id identifier rubyid_param'>param</span><span class='op'>=</span><span class='lbrace'>{</span><span class='rbrace'>}</span>
2611
- <span class='id identifier rubyid_param_s'>param_s</span> <span class='op'>=</span> <span class='id identifier rubyid_param_serializer'>param_serializer</span><span class='lparen'>(</span><span class='id identifier rubyid_param'>param</span><span class='rparen'>)</span>
2612
- <span class='kw'>begin</span>
2613
- <span class='id identifier rubyid_response'>response</span> <span class='op'>=</span> <span class='ivar'>@access_token</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='id identifier rubyid_url'>url</span><span class='op'>+</span><span class='id identifier rubyid_param_s'>param_s</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_body'>body</span>
2614
- <span class='kw'>rescue</span> <span class='op'>=&gt;</span> <span class='id identifier rubyid_vars'>vars</span>
2615
- <span class='id identifier rubyid_raise'>raise</span> <span class='const'>NetworkError</span><span class='comma'>,</span> <span class='id identifier rubyid_vars'>vars</span>
2616
- <span class='kw'>end</span>
2617
- <span class='kw'>return</span> <span class='const'>JSON</span><span class='period'>.</span><span class='id identifier rubyid_parse'>parse</span><span class='lparen'>(</span><span class='id identifier rubyid_response'>response</span><span class='rparen'>)</span>
2618
- <span class='kw'>end</span></pre>
2619
- </td>
2620
- </tr>
2621
- </table>
2622
- </div>
2623
-
2624
- <div class="method_details ">
2625
- <p class="signature " id="rate_limit-instance_method">
2626
-
2627
- - (<tt>Hash</tt>) <strong>rate_limit</strong>
2628
-
2629
-
2630
-
2631
- </p><div class="docstring">
2632
- <div class="discussion">
2633
- <p>
2634
- Rate limit statuses
2635
- </p>
2636
-
2637
-
2638
- </div>
2639
- </div>
2640
- <div class="tags">
2641
-
2642
- <h3>Returns:</h3>
2643
- <ul class="return">
2644
-
2645
- <li>
2646
-
2647
-
2648
- <span class='type'>(<tt>Hash</tt>)</span>
2649
-
2650
-
2651
-
2652
- &mdash;
2653
- <div class='inline'><p>
2654
- Rate limit statuses
2655
- </p>
2656
- </div>
2657
-
2658
- </li>
2659
-
2660
- </ul>
2661
-
2662
- </div><table class="source_code">
2663
- <tr>
2664
- <td>
2665
- <pre class="lines">
2666
-
2667
-
2668
- 12
2669
- 13
2670
- 14
2671
- 15</pre>
2672
- </td>
2673
- <td>
2674
- <pre class="code"><span class="info file"># File 'lib/pupil/account.rb', line 12</span>
2675
-
2676
- <span class='kw'>def</span> <span class='id identifier rubyid_rate_limit'>rate_limit</span>
2677
- <span class='id identifier rubyid_response'>response</span> <span class='op'>=</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>/account/rate_limit_status.json</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
2678
- <span class='kw'>return</span> <span class='id identifier rubyid_response'>response</span>
2679
- <span class='kw'>end</span></pre>
2680
- </td>
2681
- </tr>
2682
- </table>
2683
- </div>
2684
-
2685
- <div class="method_details ">
2686
- <p class="signature " id="show_status-instance_method">
2687
-
2688
- - (<tt>Object</tt>) <strong>show_status</strong>(status_id)
2689
-
2690
-
2691
-
2692
- </p><table class="source_code">
2693
- <tr>
2694
- <td>
2695
- <pre class="lines">
2696
-
2697
-
2698
- 62
2699
- 63
2700
- 64
2701
- 65
2702
- 66
2703
- 67</pre>
2704
- </td>
2705
- <td>
2706
- <pre class="code"><span class="info file"># File 'lib/pupil/statuses.rb', line 62</span>
2707
-
2708
- <span class='kw'>def</span> <span class='id identifier rubyid_show_status'>show_status</span> <span class='id identifier rubyid_status_id'>status_id</span>
2709
- <span class='id identifier rubyid_response'>response</span> <span class='op'>=</span> <span class='ivar'>@access_token</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>/statuses/show/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_status_id'>status_id</span><span class='rbrace'>}</span><span class='tstring_content'>.json</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_body'>body</span>
2710
- <span class='kw'>return</span> <span class='id identifier rubyid_response'>response</span>
2711
- <span class='id identifier rubyid_status'>status</span> <span class='op'>=</span> <span class='const'>Status</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span> <span class='id identifier rubyid_response'>response</span>
2712
- <span class='kw'>return</span> <span class='id identifier rubyid_status'>status</span>
2713
- <span class='kw'>end</span></pre>
2714
- </td>
2715
- </tr>
2716
- </table>
2717
- </div>
2718
-
2719
- <div class="method_details ">
2720
- <p class="signature " id="unblock-instance_method">
2721
-
2722
- - (<tt><span class='object_link'><a href="Pupil/User.html" title="Pupil::User (class)">Pupil::User</a></span></tt>) <strong>unblock</strong>(param)
2723
-
2724
-
2725
-
2726
- </p><div class="docstring">
2727
- <div class="discussion">
2728
- <p>
2729
- Response
2730
- </p>
2731
-
2732
-
2733
- </div>
2734
- </div>
2735
- <div class="tags">
2736
- <h3>Parameters:</h3>
2737
- <ul class="param">
2738
-
2739
- <li>
2740
-
2741
- <span class='name'>id</span>
2742
-
2743
-
2744
- <span class='type'>(<tt>Fixnum</tt>)</span>
2745
-
2746
-
2747
-
2748
- &mdash;
2749
- <div class='inline'><p>
2750
- id
2751
- </p>
2752
- </div>
2753
-
2754
- </li>
2755
-
2756
- </ul>
2757
-
2758
- <h3>Returns:</h3>
2759
- <ul class="return">
2760
-
2761
- <li>
2762
-
2763
-
2764
- <span class='type'>(<tt><span class='object_link'><a href="Pupil/User.html" title="Pupil::User (class)">Pupil::User</a></span></tt>)</span>
2765
-
2766
-
2767
-
2768
- &mdash;
2769
- <div class='inline'><p>
2770
- response
2771
- </p>
2772
- </div>
2773
-
2774
- </li>
2775
-
2776
- </ul>
2777
-
2778
- </div><table class="source_code">
2779
- <tr>
2780
- <td>
2781
- <pre class="lines">
2782
-
2783
-
2784
- 20
2785
- 21
2786
- 22
2787
- 23
2788
- 24
2789
- 25
2790
- 26
2791
- 27
2792
- 28
2793
- 29
2794
- 30
2795
- 31
2796
- 32</pre>
2797
- </td>
2798
- <td>
2799
- <pre class="code"><span class="info file"># File 'lib/pupil/blocks.rb', line 20</span>
2800
-
2801
- <span class='kw'>def</span> <span class='id identifier rubyid_unblock'>unblock</span> <span class='id identifier rubyid_param'>param</span>
2802
- <span class='kw'>case</span> <span class='id identifier rubyid_param'>param</span><span class='period'>.</span><span class='id identifier rubyid_keys'>keys</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_to_sym'>to_sym</span>
2803
- <span class='kw'>when</span> <span class='symbol'>:screen_name</span>
2804
- <span class='id identifier rubyid_response'>response</span> <span class='op'>=</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>/blocks/destroy.json</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='lbrace'>{</span><span class='symbol'>:screen_name</span> <span class='op'>=&gt;</span> <span class='id identifier rubyid_param'>param</span><span class='period'>.</span><span class='id identifier rubyid_values'>values</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span><span class='rbrace'>}</span><span class='rparen'>)</span>
2805
- <span class='kw'>when</span> <span class='symbol'>:id</span>
2806
- <span class='id identifier rubyid_response'>response</span> <span class='op'>=</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>/blocks/destroy.json</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='lbrace'>{</span><span class='symbol'>:user_id</span> <span class='op'>=&gt;</span> <span class='id identifier rubyid_param'>param</span><span class='period'>.</span><span class='id identifier rubyid_values'>values</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span><span class='rbrace'>}</span><span class='rparen'>)</span>
2807
- <span class='kw'>end</span>
2808
-
2809
- <span class='kw'>if</span> <span class='id identifier rubyid_response'>response</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span> <span class='op'>==</span> <span class='const'>Hash</span> <span class='op'>&amp;&amp;</span> <span class='id identifier rubyid_response'>response</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>id</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span>
2810
- <span class='kw'>return</span> <span class='const'>User</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span> <span class='id identifier rubyid_response'>response</span>
2811
- <span class='kw'>end</span>
2812
- <span class='kw'>return</span> <span class='kw'>false</span>
2813
- <span class='kw'>end</span></pre>
2814
- </td>
2815
- </tr>
2816
- </table>
2817
- </div>
2818
-
2819
- <div class="method_details ">
2820
- <p class="signature " id="unfollow-instance_method">
2821
-
2822
- - (<tt>Hash</tt>) <strong>unfollow</strong>(param)
2823
-
2824
-
2825
-
2826
- </p><div class="docstring">
2827
- <div class="discussion">
2828
- <p>
2829
- Unfollow user for screen_name
2830
- </p>
2831
-
2832
-
2833
- </div>
2834
- </div>
2835
- <div class="tags">
2836
- <h3>Parameters:</h3>
2837
- <ul class="param">
2838
-
2839
- <li>
2840
-
2841
- <span class='name'>name</span>
2842
-
2843
-
2844
- <span class='type'>(<tt>String</tt>)</span>
2845
-
2846
-
2847
-
2848
- &mdash;
2849
- <div class='inline'><p>
2850
- screen_name
2851
- </p>
2852
- </div>
2853
-
2854
- </li>
2855
-
2856
- </ul>
2857
-
2858
- <h3>Returns:</h3>
2859
- <ul class="return">
2860
-
2861
- <li>
2862
-
2863
-
2864
- <span class='type'>(<tt>Hash</tt>)</span>
2865
-
2866
-
2867
-
2868
- &mdash;
2869
- <div class='inline'><p>
2870
- response
2871
- </p>
2872
- </div>
2873
-
2874
- </li>
2875
-
2876
- </ul>
2877
-
2878
- </div><table class="source_code">
2879
- <tr>
2880
- <td>
2881
- <pre class="lines">
2882
-
2883
-
2884
- 57
2885
- 58
2886
- 59
2887
- 60
2888
- 61
2889
- 62
2890
- 63
2891
- 64
2892
- 65
2893
- 66
2894
- 67
2895
- 68
2896
- 69</pre>
2897
- </td>
2898
- <td>
2899
- <pre class="code"><span class="info file"># File 'lib/pupil/friendships.rb', line 57</span>
2900
-
2901
- <span class='kw'>def</span> <span class='id identifier rubyid_unfollow'>unfollow</span> <span class='id identifier rubyid_param'>param</span>
2902
- <span class='kw'>case</span> <span class='id identifier rubyid_param'>param</span><span class='period'>.</span><span class='id identifier rubyid_keys'>keys</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_to_sym'>to_sym</span>
2903
- <span class='kw'>when</span> <span class='symbol'>:screen_name</span>
2904
- <span class='id identifier rubyid_response'>response</span> <span class='op'>=</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>/friendships/destroy.json</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='lbrace'>{</span><span class='symbol'>:screen_name</span> <span class='op'>=&gt;</span> <span class='id identifier rubyid_param'>param</span><span class='period'>.</span><span class='id identifier rubyid_values'>values</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span><span class='rbrace'>}</span><span class='rparen'>)</span>
2905
- <span class='kw'>when</span> <span class='symbol'>:id</span>
2906
- <span class='id identifier rubyid_response'>response</span> <span class='op'>=</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>/friendships/destroy.json</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='lbrace'>{</span><span class='symbol'>:user_id</span> <span class='op'>=&gt;</span> <span class='id identifier rubyid_param'>param</span><span class='period'>.</span><span class='id identifier rubyid_values'>values</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span><span class='rbrace'>}</span><span class='rparen'>)</span>
2907
- <span class='kw'>end</span>
2908
-
2909
- <span class='kw'>if</span> <span class='id identifier rubyid_response'>response</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span> <span class='op'>==</span> <span class='const'>Hash</span> <span class='op'>&amp;&amp;</span> <span class='id identifier rubyid_response'>response</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>id</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span>
2910
- <span class='kw'>return</span> <span class='const'>User</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span> <span class='id identifier rubyid_response'>response</span>
2911
- <span class='kw'>end</span>
2912
- <span class='kw'>return</span> <span class='kw'>false</span>
2913
- <span class='kw'>end</span></pre>
2914
- </td>
2915
- </tr>
2916
- </table>
2917
- </div>
2918
-
2919
- <div class="method_details ">
2920
- <p class="signature " id="update-instance_method">
2921
-
2922
- - (<tt>Object</tt>) <strong>update</strong>(status, irt = '')
2923
-
2924
-
2925
-
2926
- <span class="aliases">Also known as:
2927
- <span class="names"><span id='tweet-instance_method'>tweet</span></span>
2928
- </span>
2929
-
2930
- </p><table class="source_code">
2931
- <tr>
2932
- <td>
2933
- <pre class="lines">
2934
-
2935
-
2936
- 69
2937
- 70
2938
- 71
2939
- 72
2940
- 73
2941
- 74
2942
- 75
2943
- 76</pre>
2944
- </td>
2945
- <td>
2946
- <pre class="code"><span class="info file"># File 'lib/pupil/statuses.rb', line 69</span>
2947
-
2948
- <span class='kw'>def</span> <span class='id identifier rubyid_update'>update</span><span class='lparen'>(</span><span class='id identifier rubyid_status'>status</span><span class='comma'>,</span> <span class='id identifier rubyid_irt'>irt</span><span class='op'>=</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
2949
- <span class='id identifier rubyid_response'>response</span> <span class='op'>=</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span>
2950
- <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>/statuses/update.json</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span>
2951
- <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>status</span><span class='tstring_end'>&quot;</span></span><span class='op'>=&gt;</span> <span class='id identifier rubyid_status'>status</span><span class='comma'>,</span>
2952
- <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>in_reply_to_status_id</span><span class='tstring_end'>&quot;</span></span> <span class='op'>=&gt;</span> <span class='id identifier rubyid_irt'>irt</span>
2953
- <span class='rparen'>)</span>
2954
- <span class='kw'>return</span> <span class='id identifier rubyid_response'>response</span>
2955
- <span class='kw'>end</span></pre>
2956
- </td>
2957
- </tr>
2958
- </table>
2959
- </div>
2960
-
2961
- <div class="method_details ">
2962
- <p class="signature " id="update_profile-instance_method">
2963
-
2964
- - (<tt><span class='object_link'><a href="Pupil/User.html" title="Pupil::User (class)">Pupil::User</a></span></tt>) <strong>update_profile</strong>(param)
2965
-
2966
-
2967
-
2968
- </p><div class="docstring">
2969
- <div class="discussion">
2970
- <p>
2971
- Update profile
2972
- </p>
2973
-
2974
-
2975
- </div>
2976
- </div>
2977
- <div class="tags">
2978
- <h3>Parameters:</h3>
2979
- <ul class="param">
2980
-
2981
- <li>
2982
-
2983
- <span class='name'>param</span>
2984
-
2985
-
2986
- <span class='type'>(<tt>Hash</tt>)</span>
2987
-
2988
-
2989
-
2990
- </li>
2991
-
2992
- </ul>
2993
-
2994
-
2995
-
2996
-
2997
- <h3>Options Hash (<tt>param</tt>):</h3>
2998
- <ul class="option">
2999
-
3000
- <li>
3001
- <span class="name">:name</span>
3002
- <span class="type">(<tt>String</tt>)</span>
3003
- <span class="default">
3004
-
3005
- </span>
3006
-
3007
- </li>
3008
-
3009
- <li>
3010
- <span class="name">:url</span>
3011
- <span class="type">(<tt>String</tt>)</span>
3012
- <span class="default">
3013
-
3014
- </span>
3015
-
3016
- </li>
3017
-
3018
- <li>
3019
- <span class="name">:location</span>
3020
- <span class="type">(<tt>String</tt>)</span>
3021
- <span class="default">
3022
-
3023
- </span>
3024
-
3025
- </li>
3026
-
3027
- <li>
3028
- <span class="name">:description</span>
3029
- <span class="type">(<tt>String</tt>)</span>
3030
- <span class="default">
3031
-
3032
- </span>
3033
-
3034
- </li>
3035
-
3036
- <li>
3037
- <span class="name">:colors</span>
3038
- <span class="type">(<tt>String</tt>)</span>
3039
- <span class="default">
3040
-
3041
- </span>
3042
- &mdash; <div class='inline'><p>
3043
- #=> :background
3044
- </p>
3045
- </div>
3046
- </li>
3047
-
3048
- <li>
3049
- <span class="name">:colors</span>
3050
- <span class="type">(<tt>String</tt>)</span>
3051
- <span class="default">
3052
-
3053
- </span>
3054
- &mdash; <div class='inline'><p>
3055
- #=> :link
3056
- </p>
3057
- </div>
3058
- </li>
3059
-
3060
- <li>
3061
- <span class="name">:colors</span>
3062
- <span class="type">(<tt>String</tt>)</span>
3063
- <span class="default">
3064
-
3065
- </span>
3066
- &mdash; <div class='inline'><p>
3067
- #=> :sidebar_border
3068
- </p>
3069
- </div>
3070
- </li>
3071
-
3072
- <li>
3073
- <span class="name">:colors</span>
3074
- <span class="type">(<tt>String</tt>)</span>
3075
- <span class="default">
3076
-
3077
- </span>
3078
- &mdash; <div class='inline'><p>
3079
- #=> :sidebar_fill
3080
- </p>
3081
- </div>
3082
- </li>
3083
-
3084
- <li>
3085
- <span class="name">:colors</span>
3086
- <span class="type">(<tt>String</tt>)</span>
3087
- <span class="default">
3088
-
3089
- </span>
3090
- &mdash; <div class='inline'><p>
3091
- #=> :text
3092
- </p>
3093
- </div>
3094
- </li>
3095
-
3096
- </ul>
3097
-
3098
-
3099
- <h3>Returns:</h3>
3100
- <ul class="return">
3101
-
3102
- <li>
3103
-
3104
-
3105
- <span class='type'>(<tt><span class='object_link'><a href="Pupil/User.html" title="Pupil::User (class)">Pupil::User</a></span></tt>)</span>
3106
-
3107
-
3108
-
3109
- &mdash;
3110
- <div class='inline'><p>
3111
- Updated profile
3112
- </p>
3113
- </div>
3114
-
3115
- </li>
3116
-
3117
- </ul>
3118
-
3119
- </div><table class="source_code">
3120
- <tr>
3121
- <td>
3122
- <pre class="lines">
3123
-
3124
-
3125
- 36
3126
- 37
3127
- 38
3128
- 39
3129
- 40
3130
- 41
3131
- 42
3132
- 43
3133
- 44
3134
- 45
3135
- 46
3136
- 47
3137
- 48
3138
- 49
3139
- 50</pre>
3140
- </td>
3141
- <td>
3142
- <pre class="code"><span class="info file"># File 'lib/pupil/account.rb', line 36</span>
3143
-
3144
- <span class='kw'>def</span> <span class='id identifier rubyid_update_profile'>update_profile</span> <span class='id identifier rubyid_param'>param</span>
3145
- <span class='kw'>if</span> <span class='id identifier rubyid_param'>param</span><span class='period'>.</span><span class='id identifier rubyid_key?'>key?</span> <span class='symbol'>:colors</span>
3146
- <span class='id identifier rubyid_opt'>opt</span> <span class='op'>=</span> <span class='const'>Hash</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
3147
- <span class='id identifier rubyid_opt'>opt</span><span class='period'>.</span><span class='id identifier rubyid_update'>update</span><span class='lparen'>(</span><span class='lbrace'>{</span><span class='symbol'>:profile_background_color</span> <span class='op'>=&gt;</span> <span class='id identifier rubyid_param'>param</span><span class='lbracket'>[</span><span class='symbol'>:colors</span><span class='rbracket'>]</span><span class='lbracket'>[</span><span class='symbol'>:background</span><span class='rbracket'>]</span><span class='rbrace'>}</span><span class='rparen'>)</span> <span class='kw'>if</span> <span class='id identifier rubyid_param'>param</span><span class='lbracket'>[</span><span class='symbol'>:colors</span><span class='rbracket'>]</span><span class='lbracket'>[</span><span class='symbol'>:background</span><span class='rbracket'>]</span>
3148
- <span class='id identifier rubyid_opt'>opt</span><span class='period'>.</span><span class='id identifier rubyid_update'>update</span><span class='lparen'>(</span><span class='lbrace'>{</span><span class='symbol'>:profile_link_color</span> <span class='op'>=&gt;</span> <span class='id identifier rubyid_param'>param</span><span class='lbracket'>[</span><span class='symbol'>:colors</span><span class='rbracket'>]</span><span class='lbracket'>[</span><span class='symbol'>:link</span><span class='rbracket'>]</span><span class='rbrace'>}</span><span class='rparen'>)</span> <span class='kw'>if</span> <span class='id identifier rubyid_param'>param</span><span class='lbracket'>[</span><span class='symbol'>:colors</span><span class='rbracket'>]</span><span class='lbracket'>[</span><span class='symbol'>:link</span><span class='rbracket'>]</span>
3149
- <span class='id identifier rubyid_opt'>opt</span><span class='period'>.</span><span class='id identifier rubyid_update'>update</span><span class='lparen'>(</span><span class='lbrace'>{</span><span class='symbol'>:profile_sidebar_border</span> <span class='op'>=&gt;</span> <span class='id identifier rubyid_param'>param</span><span class='lbracket'>[</span><span class='symbol'>:colors</span><span class='rbracket'>]</span><span class='lbracket'>[</span><span class='symbol'>:sidebar_border</span><span class='rbracket'>]</span><span class='rbrace'>}</span><span class='rparen'>)</span> <span class='kw'>if</span> <span class='id identifier rubyid_param'>param</span><span class='lbracket'>[</span><span class='symbol'>:colors</span><span class='rbracket'>]</span><span class='lbracket'>[</span><span class='symbol'>:sidebar_border</span><span class='rbracket'>]</span>
3150
- <span class='id identifier rubyid_opt'>opt</span><span class='period'>.</span><span class='id identifier rubyid_update'>update</span><span class='lparen'>(</span><span class='lbrace'>{</span><span class='symbol'>:profile_sidebar_fill</span> <span class='op'>=&gt;</span> <span class='id identifier rubyid_param'>param</span><span class='lbracket'>[</span><span class='symbol'>:colors</span><span class='rbracket'>]</span><span class='lbracket'>[</span><span class='symbol'>:sidebar_fill</span><span class='rbracket'>]</span><span class='rbrace'>}</span><span class='rparen'>)</span> <span class='kw'>if</span> <span class='id identifier rubyid_param'>param</span><span class='lbracket'>[</span><span class='symbol'>:colors</span><span class='rbracket'>]</span><span class='lbracket'>[</span><span class='symbol'>:sidebar_fill</span><span class='rbracket'>]</span>
3151
- <span class='id identifier rubyid_oot'>oot</span><span class='period'>.</span><span class='id identifier rubyid_update'>update</span><span class='lparen'>(</span><span class='lbrace'>{</span><span class='symbol'>:profile_text_color</span> <span class='op'>=&gt;</span> <span class='id identifier rubyid_param'>param</span><span class='lbracket'>[</span><span class='symbol'>:colors</span><span class='rbracket'>]</span><span class='lbracket'>[</span><span class='symbol'>:text</span><span class='rbracket'>]</span><span class='rbrace'>}</span><span class='rparen'>)</span> <span class='kw'>if</span> <span class='id identifier rubyid_param'>param</span><span class='lbracket'>[</span><span class='symbol'>:colors</span><span class='rbracket'>]</span><span class='lbracket'>[</span><span class='symbol'>:text</span><span class='rbracket'>]</span>
3152
- <span class='id identifier rubyid_param'>param</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span> <span class='symbol'>:colors</span>
3153
- <span class='id identifier rubyid_response'>response</span> <span class='op'>=</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>/account/update_profile_colors.json</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='id identifier rubyid_opt'>opt</span><span class='rparen'>)</span>
3154
- <span class='kw'>return</span> <span class='const'>User</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span> <span class='id identifier rubyid_response'>response</span> <span class='kw'>if</span> <span class='id identifier rubyid_param'>param</span><span class='period'>.</span><span class='id identifier rubyid_size'>size</span> <span class='op'>&lt;=</span> <span class='int'>0</span>
3155
- <span class='kw'>end</span>
3156
- <span class='id identifier rubyid_response2'>response2</span> <span class='op'>=</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>/account/update_profile.json</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='id identifier rubyid_param'>param</span><span class='rparen'>)</span>
3157
- <span class='kw'>return</span> <span class='const'>User</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span> <span class='id identifier rubyid_response2'>response2</span>
3158
- <span class='kw'>end</span></pre>
3159
- </td>
3160
- </tr>
3161
- </table>
3162
- </div>
3163
-
3164
- <div class="method_details ">
3165
- <p class="signature " id="user_timeline-instance_method">
3166
-
3167
- - (<tt>Hash</tt>) <strong>user_timeline</strong>(param = {})
3168
-
3169
-
3170
-
3171
- </p><div class="docstring">
3172
- <div class="discussion">
3173
- <p>
3174
- Returning user timeline
3175
- </p>
3176
-
3177
-
3178
- </div>
3179
- </div>
3180
- <div class="tags">
3181
-
3182
- <div class="examples">
3183
- <h3>Examples:</h3>
3184
-
3185
- <h4><div class='inline'></div></h4>
3186
- <pre class="example code"><span class='id identifier rubyid_twitter'>twitter</span> <span class='op'>=</span> <span class='const'>Pupil</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span> <span class='const'>PUPIL_KEY</span>
3187
- <span class='id identifier rubyid_twitter'>twitter</span><span class='period'>.</span><span class='id identifier rubyid_user_timeline'>user_timeline</span><span class='lparen'>(</span><span class='symbol'>:screen_name</span> <span class='op'>=&gt;</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>o_ame</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='symbol'>:exclude</span> <span class='op'>=&gt;</span> <span class='symbol'>:replies</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_status'>status</span><span class='op'>|</span>
3188
- <span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_status'>status</span><span class='period'>.</span><span class='id identifier rubyid_user'>user</span><span class='period'>.</span><span class='id identifier rubyid_screen_name'>screen_name</span><span class='rbrace'>}</span><span class='tstring_content'>: </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_status'>status</span><span class='period'>.</span><span class='id identifier rubyid_text'>text</span><span class='rbrace'>}</span><span class='tstring_end'>&quot;</span></span>
3189
- <span class='kw'>end</span></pre>
3190
-
3191
- </div>
3192
- <h3>Parameters:</h3>
3193
- <ul class="param">
3194
-
3195
- <li>
3196
-
3197
- <span class='name'>param</span>
3198
-
3199
-
3200
- <span class='type'>(<tt>Hash</tt>)</span>
3201
-
3202
-
3203
- <em class="default">(defaults to: <tt>{}</tt>)</em>
3204
-
3205
-
3206
- </li>
3207
-
3208
- </ul>
3209
-
3210
-
3211
-
3212
-
3213
- <h3>Options Hash (<tt>param</tt>):</h3>
3214
- <ul class="option">
3215
-
3216
- <li>
3217
- <span class="name">:user_id</span>
3218
- <span class="type">(<tt>Fixnum</tt>)</span>
3219
- <span class="default">
3220
-
3221
- </span>
3222
- &mdash; <div class='inline'><p>
3223
- The ID of user
3224
- </p>
3225
- </div>
3226
- </li>
3227
-
3228
- <li>
3229
- <span class="name">:screen_name</span>
3230
- <span class="type">(<tt>String</tt>)</span>
3231
- <span class="default">
3232
-
3233
- </span>
3234
- &mdash; <div class='inline'><p>
3235
- The Screen name of user
3236
- </p>
3237
- </div>
3238
- </li>
3239
-
3240
- <li>
3241
- <span class="name">:since_id</span>
3242
- <span class="type">(<tt>Fixnum</tt>)</span>
3243
- <span class="default">
3244
-
3245
- </span>
3246
-
3247
- </li>
3248
-
3249
- <li>
3250
- <span class="name">:max_id</span>
3251
- <span class="type">(<tt>Fixnum</tt>)</span>
3252
- <span class="default">
3253
-
3254
- </span>
3255
-
3256
- </li>
3257
-
3258
- <li>
3259
- <span class="name">:count</span>
3260
- <span class="type">(<tt>Fixnum</tt>)</span>
3261
- <span class="default">
3262
-
3263
- </span>
3264
-
3265
- </li>
3266
-
3267
- <li>
3268
- <span class="name">:page</span>
3269
- <span class="type">(<tt>Fixnum</tt>)</span>
3270
- <span class="default">
3271
-
3272
- </span>
3273
- &mdash; <div class='inline'><p>
3274
- Specifies
3275
- </p>
3276
- </div>
3277
- </li>
3278
-
3279
- <li>
3280
- <span class="name">:trim_user</span>
3281
- <span class="type">(<tt>Symbol</tt>)</span>
3282
- <span class="default">
3283
-
3284
- </span>
3285
-
3286
- </li>
3287
-
3288
- <li>
3289
- <span class="name">:include</span>
3290
- <span class="type">(<tt>Symbol</tt>)</span>
3291
- <span class="default">
3292
-
3293
- </span>
3294
- &mdash; <div class='inline'><p>
3295
- #=> [:rts]
3296
- </p>
3297
- </div>
3298
- </li>
3299
-
3300
- <li>
3301
- <span class="name">:exclude</span>
3302
- <span class="type">(<tt>Symbol</tt>)</span>
3303
- <span class="default">
3304
-
3305
- </span>
3306
- &mdash; <div class='inline'><p>
3307
- #=> [:replies]
3308
- </p>
3309
- </div>
3310
- </li>
3311
-
3312
- <li>
3313
- <span class="name">:contributor_details</span>
3314
- <span class="type">(<tt>Symbol</tt>)</span>
3315
- <span class="default">
3316
-
3317
- </span>
3318
-
3319
- </li>
3320
-
3321
- </ul>
3322
-
3323
-
3324
- <h3>Returns:</h3>
3325
- <ul class="return">
3326
-
3327
- <li>
3328
-
3329
-
3330
- <span class='type'>(<tt>Hash</tt>)</span>
3331
-
3332
-
3333
-
3334
- &mdash;
3335
- <div class='inline'><p>
3336
- timeline
3337
- </p>
3338
- </div>
3339
-
3340
- </li>
3341
-
3342
- </ul>
3343
-
3344
- </div><table class="source_code">
3345
- <tr>
3346
- <td>
3347
- <pre class="lines">
3348
-
3349
-
3350
- 52
3351
- 53
3352
- 54
3353
- 55
3354
- 56
3355
- 57
3356
- 58
3357
- 59
3358
- 60</pre>
3359
- </td>
3360
- <td>
3361
- <pre class="code"><span class="info file"># File 'lib/pupil/statuses.rb', line 52</span>
3362
-
3363
- <span class='kw'>def</span> <span class='id identifier rubyid_user_timeline'>user_timeline</span> <span class='id identifier rubyid_param'>param</span><span class='op'>=</span><span class='lbrace'>{</span><span class='rbrace'>}</span>
3364
- <span class='id identifier rubyid_response'>response</span> <span class='op'>=</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>/statuses/user_timeline.json</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='id identifier rubyid_param'>param</span><span class='rparen'>)</span>
3365
- <span class='id identifier rubyid_statuses'>statuses</span> <span class='op'>=</span> <span class='const'>Array</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
3366
- <span class='id identifier rubyid_response'>response</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_element'>element</span><span class='op'>|</span>
3367
- <span class='id identifier rubyid_status'>status</span> <span class='op'>=</span> <span class='const'>Status</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span> <span class='id identifier rubyid_element'>element</span>
3368
- <span class='id identifier rubyid_statuses'>statuses</span> <span class='op'>&lt;&lt;</span> <span class='id identifier rubyid_status'>status</span>
3369
- <span class='kw'>end</span>
3370
- <span class='kw'>return</span> <span class='id identifier rubyid_statuses'>statuses</span>
3371
- <span class='kw'>end</span></pre>
3372
- </td>
3373
- </tr>
3374
- </table>
3375
- </div>
3376
-
3377
- <div class="method_details ">
3378
- <p class="signature " id="verify_credentials-instance_method">
3379
-
3380
- - (<tt><span class='object_link'><a href="Pupil/User.html" title="Pupil::User (class)">Pupil::User</a></span></tt>) <strong>verify_credentials</strong>
3381
-
3382
-
3383
-
3384
- </p><div class="docstring">
3385
- <div class="discussion">
3386
- <p>
3387
- Verify credentials
3388
- </p>
3389
-
3390
-
3391
- </div>
3392
- </div>
3393
- <div class="tags">
3394
-
3395
- <h3>Returns:</h3>
3396
- <ul class="return">
3397
-
3398
- <li>
3399
-
3400
-
3401
- <span class='type'>(<tt><span class='object_link'><a href="Pupil/User.html" title="Pupil::User (class)">Pupil::User</a></span></tt>)</span>
3402
-
3403
-
3404
-
3405
- &mdash;
3406
- <div class='inline'><p>
3407
- User credentials
3408
- </p>
3409
- </div>
3410
-
3411
- </li>
3412
-
3413
- </ul>
3414
-
3415
- </div><table class="source_code">
3416
- <tr>
3417
- <td>
3418
- <pre class="lines">
3419
-
3420
-
3421
- 4
3422
- 5
3423
- 6
3424
- 7
3425
- 8</pre>
3426
- </td>
3427
- <td>
3428
- <pre class="code"><span class="info file"># File 'lib/pupil/account.rb', line 4</span>
3429
-
3430
- <span class='kw'>def</span> <span class='id identifier rubyid_verify_credentials'>verify_credentials</span>
3431
- <span class='id identifier rubyid_response'>response</span> <span class='op'>=</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>/account/verify_credentials.json</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
3432
- <span class='id identifier rubyid_user'>user</span> <span class='op'>=</span> <span class='const'>User</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span> <span class='id identifier rubyid_response'>response</span>
3433
- <span class='kw'>return</span> <span class='id identifier rubyid_user'>user</span>
3434
- <span class='kw'>end</span></pre>
3435
- </td>
3436
- </tr>
3437
- </table>
3438
- </div>
3439
-
3440
- </div>
3441
-
3442
- </div>
3443
-
3444
- <div id="footer">
3445
- Generated on Sat Dec 17 20:58:32 2011 by
3446
- <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
3447
- 0.7.4 (ruby-1.9.2).
3448
- </div>
3449
-
3450
- </body>
3451
- </html>