pupil 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -6,7 +6,7 @@
6
6
  <title>
7
7
  Top Level Namespace
8
8
 
9
- &mdash; Documentation by YARD 0.7.3
9
+ &mdash; Documentation by YARD 0.7.4
10
10
 
11
11
  </title>
12
12
 
@@ -94,9 +94,9 @@
94
94
  </div>
95
95
 
96
96
  <div id="footer">
97
- Generated on Fri Dec 16 17:19:17 2011 by
97
+ Generated on Sat Dec 17 20:58:33 2011 by
98
98
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
99
- 0.7.3 (ruby-1.9.2).
99
+ 0.7.4 (ruby-1.9.2).
100
100
  </div>
101
101
 
102
102
  </body>
@@ -14,8 +14,6 @@ class Pupil
14
14
  # @param [Hash] pupil_key
15
15
  def initialize key
16
16
  @screen_name = key[:screen_name]
17
- @client = nil
18
- @config = nil
19
17
 
20
18
  @consumer = OAuth::Consumer.new(
21
19
  key[:consumer_key],
@@ -1,5 +1,6 @@
1
1
  class Pupil
2
2
  class Stream
3
+ attr_reader :screen_name
3
4
  class StreamError < StandardError ; end
4
5
  STREAM_APIS = {
5
6
  :userstream => "https://userstream.twitter.com/2/user.json",
@@ -8,8 +9,6 @@ class Pupil
8
9
 
9
10
  def initialize key
10
11
  @screen_name = key[:screen_name]
11
- @client = nil
12
- @config = nil
13
12
 
14
13
  @consumer = OAuth::Consumer.new(
15
14
  key[:consumer_key],
@@ -22,7 +21,8 @@ class Pupil
22
21
  key[:access_token_secret]
23
22
  )
24
23
  end
25
-
24
+
25
+ # @return [Pupil::Stream::Shash, Pupil::Stream::Status] event variable supported :status, :retweeted, :favorite, :friends and :delete
26
26
  def start(type, param=nil, &block)
27
27
  raise ArgumentError unless block_given?
28
28
 
@@ -55,7 +55,8 @@ class Pupil
55
55
  break
56
56
  end
57
57
 
58
- block.call StreamEvent.new(status)
58
+ event = self.guess_event status
59
+ block.call event
59
60
  end
60
61
  end
61
62
  end
@@ -66,29 +67,52 @@ class Pupil
66
67
  end
67
68
  end
68
69
 
69
- class StreamEvent
70
- attr_reader :type
71
- attr_reader :content
70
+ def guess_event status
71
+ if status["delete"]
72
+ return Shash.new(:delete, status["delete"]["status"])
73
+ elsif status["friends"]
74
+ return Shash.new(:friends, status["friends"])
75
+ elsif status["event"] == "favorite"
76
+ return Shash.new(:favorite, status)
77
+ elsif status["retweeted_status"]
78
+ return Status.new(status, :retweeted)
79
+ elsif status["text"]
80
+ return Status.new(status)
81
+ else
82
+ return Shash.new(:unknown, status)
83
+ end
84
+ end
85
+
86
+ # Stream Status
87
+ class Status < Pupil::Status
88
+ attr_reader :event
89
+ attr_reader :retweeted_status
72
90
 
73
- def initialize status
74
- @type, @content = self.guess_event status
91
+ def initialize status, event=nil
92
+ super(status)
93
+ @event = (event)? event : :status
94
+ @retweeted_status = status["retweeted_status"]
75
95
  end
96
+ end
97
+
98
+ # Stream Hash
99
+ class Shash
100
+ attr_reader :event
76
101
 
77
- def guess_event status
78
- if status["delete"]
79
- return :delete, status["delete"]["status"]
80
- elsif status["friends"]
81
- return :friends, status["friends"]
82
- elsif status["event"] == "favorite"
83
- return :favorite, status
84
- elsif status["retweeted_status"]
85
- return :retweet, status
86
- elsif status["text"]
87
- return :status, status#Pupil::Status.new(status)
88
- else
89
- return :unknown, status
90
- end
102
+ def initialize event, status
103
+ @hash = status
104
+ @event = event
105
+ end
106
+
107
+ def [] param
108
+ @hash[param]
91
109
  end
110
+
111
+ def size
112
+ @hash.size
113
+ end
114
+
115
+ alias_method :length, :size
92
116
  end
93
117
  end
94
118
  end
@@ -0,0 +1,114 @@
1
+ # Generated by jeweler
2
+ # DO NOT EDIT THIS FILE DIRECTLY
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
+ # -*- encoding: utf-8 -*-
5
+
6
+ Gem::Specification.new do |s|
7
+ s.name = "pupil"
8
+ s.version = "0.1.2"
9
+
10
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
+ s.authors = ["Oame"]
12
+ s.date = "2011-12-17"
13
+ s.description = "The \"Lazy\" Twitter API Library for Ruby 1.9.x. Easy to use."
14
+ s.email = "oame@oameya.com"
15
+ s.extra_rdoc_files = [
16
+ "LICENSE.txt",
17
+ "README.md"
18
+ ]
19
+ s.files = [
20
+ "CHANGELOG.md",
21
+ "Gemfile",
22
+ "Gemfile.lock",
23
+ "LICENSE.txt",
24
+ "README.md",
25
+ "Rakefile",
26
+ "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
+ "lib/pupil.rb",
59
+ "lib/pupil/account.rb",
60
+ "lib/pupil/base.rb",
61
+ "lib/pupil/blocks.rb",
62
+ "lib/pupil/direct_messages.rb",
63
+ "lib/pupil/friendships.rb",
64
+ "lib/pupil/keygen.rb",
65
+ "lib/pupil/keygen/base.rb",
66
+ "lib/pupil/lists.rb",
67
+ "lib/pupil/schemes.rb",
68
+ "lib/pupil/statuses.rb",
69
+ "lib/pupil/stream.rb",
70
+ "lib/pupil/stream/base.rb",
71
+ "lib/pupil/users.rb",
72
+ "pupil.gemspec",
73
+ "samples/generate-key.rb",
74
+ "spec/pupil_spec.rb",
75
+ "spec/spec_helper.rb"
76
+ ]
77
+ s.homepage = "http://github.com/oame/pupil"
78
+ s.licenses = ["MIT"]
79
+ s.require_paths = ["lib"]
80
+ s.required_ruby_version = Gem::Requirement.new("~> 1.9.0")
81
+ s.rubygems_version = "1.8.10"
82
+ s.summary = "The \"Lazy\" Twitter API Library for Ruby 1.9.x"
83
+
84
+ if s.respond_to? :specification_version then
85
+ s.specification_version = 3
86
+
87
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
88
+ s.add_runtime_dependency(%q<oauth>, [">= 0"])
89
+ s.add_runtime_dependency(%q<json>, [">= 0"])
90
+ s.add_development_dependency(%q<rspec>, ["~> 2.3.0"])
91
+ s.add_development_dependency(%q<yard>, ["~> 0.6.0"])
92
+ s.add_development_dependency(%q<bundler>, ["~> 1.0.0"])
93
+ s.add_development_dependency(%q<jeweler>, ["~> 1.6.4"])
94
+ s.add_development_dependency(%q<rcov>, [">= 0"])
95
+ else
96
+ s.add_dependency(%q<oauth>, [">= 0"])
97
+ s.add_dependency(%q<json>, [">= 0"])
98
+ s.add_dependency(%q<rspec>, ["~> 2.3.0"])
99
+ s.add_dependency(%q<yard>, ["~> 0.6.0"])
100
+ s.add_dependency(%q<bundler>, ["~> 1.0.0"])
101
+ s.add_dependency(%q<jeweler>, ["~> 1.6.4"])
102
+ s.add_dependency(%q<rcov>, [">= 0"])
103
+ end
104
+ else
105
+ s.add_dependency(%q<oauth>, [">= 0"])
106
+ s.add_dependency(%q<json>, [">= 0"])
107
+ s.add_dependency(%q<rspec>, ["~> 2.3.0"])
108
+ s.add_dependency(%q<yard>, ["~> 0.6.0"])
109
+ s.add_dependency(%q<bundler>, ["~> 1.0.0"])
110
+ s.add_dependency(%q<jeweler>, ["~> 1.6.4"])
111
+ s.add_dependency(%q<rcov>, [">= 0"])
112
+ end
113
+ end
114
+
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.1
4
+ version: 0.1.2
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-16 00:00:00.000000000 Z
12
+ date: 2011-12-17 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: oauth
16
- requirement: &70231264295240 !ruby/object:Gem::Requirement
16
+ requirement: &70356539340180 !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: *70231264295240
24
+ version_requirements: *70356539340180
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: json
27
- requirement: &70231264294480 !ruby/object:Gem::Requirement
27
+ requirement: &70356539339540 !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: *70231264294480
35
+ version_requirements: *70356539339540
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: rspec
38
- requirement: &70231264293820 !ruby/object:Gem::Requirement
38
+ requirement: &70356539338740 !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: *70231264293820
46
+ version_requirements: *70356539338740
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: yard
49
- requirement: &70231264293280 !ruby/object:Gem::Requirement
49
+ requirement: &70356539338000 !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: *70231264293280
57
+ version_requirements: *70356539338000
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: bundler
60
- requirement: &70231264292700 !ruby/object:Gem::Requirement
60
+ requirement: &70356539337300 !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: *70231264292700
68
+ version_requirements: *70356539337300
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: jeweler
71
- requirement: &70231264292200 !ruby/object:Gem::Requirement
71
+ requirement: &70356539336680 !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: *70231264292200
79
+ version_requirements: *70356539336680
80
80
  - !ruby/object:Gem::Dependency
81
81
  name: rcov
82
- requirement: &70231264291680 !ruby/object:Gem::Requirement
82
+ requirement: &70356539335940 !ruby/object:Gem::Requirement
83
83
  none: false
84
84
  requirements:
85
85
  - - ! '>='
@@ -87,21 +87,20 @@ dependencies:
87
87
  version: '0'
88
88
  type: :development
89
89
  prerelease: false
90
- version_requirements: *70231264291680
90
+ version_requirements: *70356539335940
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: []
94
94
  extensions: []
95
95
  extra_rdoc_files:
96
96
  - LICENSE.txt
97
- - README.rdoc
97
+ - README.md
98
98
  files:
99
- - .document
100
- - .rspec
99
+ - CHANGELOG.md
101
100
  - Gemfile
102
101
  - Gemfile.lock
103
102
  - LICENSE.txt
104
- - README.rdoc
103
+ - README.md
105
104
  - Rakefile
106
105
  - VERSION
107
106
  - doc/Pupil.html
@@ -114,8 +113,9 @@ files:
114
113
  - doc/Pupil/NetworkError.html
115
114
  - doc/Pupil/Status.html
116
115
  - doc/Pupil/Stream.html
116
+ - doc/Pupil/Stream/Shash.html
117
+ - doc/Pupil/Stream/Status.html
117
118
  - doc/Pupil/Stream/StreamError.html
118
- - doc/Pupil/Stream/StreamEvent.html
119
119
  - doc/Pupil/URL.html
120
120
  - doc/Pupil/UnsupportedParameter.html
121
121
  - doc/Pupil/User.html
@@ -148,6 +148,7 @@ files:
148
148
  - lib/pupil/stream.rb
149
149
  - lib/pupil/stream/base.rb
150
150
  - lib/pupil/users.rb
151
+ - pupil.gemspec
151
152
  - samples/generate-key.rb
152
153
  - spec/pupil_spec.rb
153
154
  - spec/spec_helper.rb
@@ -161,12 +162,9 @@ require_paths:
161
162
  required_ruby_version: !ruby/object:Gem::Requirement
162
163
  none: false
163
164
  requirements:
164
- - - ! '>='
165
+ - - ~>
165
166
  - !ruby/object:Gem::Version
166
- version: '0'
167
- segments:
168
- - 0
169
- hash: -3748164186689792004
167
+ version: 1.9.0
170
168
  required_rubygems_version: !ruby/object:Gem::Requirement
171
169
  none: false
172
170
  requirements:
@@ -175,7 +173,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
175
173
  version: '0'
176
174
  requirements: []
177
175
  rubyforge_project:
178
- rubygems_version: 1.8.12
176
+ rubygems_version: 1.8.10
179
177
  signing_key:
180
178
  specification_version: 3
181
179
  summary: The "Lazy" Twitter API Library for Ruby 1.9.x
data/.document DELETED
@@ -1,5 +0,0 @@
1
- lib/**/*.rb
2
- bin/*
3
- -
4
- features/**/*.feature
5
- LICENSE.txt
data/.rspec DELETED
@@ -1 +0,0 @@
1
- --color
@@ -1,19 +0,0 @@
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
-
@@ -1,421 +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::Stream::StreamEvent
8
-
9
- &mdash; Documentation by YARD 0.7.3
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 (S)</a> &raquo;
37
- <span class='title'><span class='object_link'><a href="../../Pupil.html" title="Pupil (class)">Pupil</a></span></span> &raquo; <span class='title'><span class='object_link'><a href="../Stream.html" title="Pupil::Stream (class)">Stream</a></span></span>
38
- &raquo;
39
- <span class="title">StreamEvent</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::Stream::StreamEvent
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::Stream::StreamEvent</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/stream/base.rb</dd>
91
-
92
- </dl>
93
- <div class="clear"></div>
94
-
95
-
96
-
97
- <h2>Instance Attribute Summary <small>(<a href="#" class="summary_toggle">collapse</a>)</small></h2>
98
- <ul class="summary">
99
-
100
- <li class="public ">
101
- <span class="summary_signature">
102
-
103
- <a href="#content-instance_method" title="#content (instance method)">- (Object) <strong>content</strong> </a>
104
-
105
-
106
-
107
- </span>
108
-
109
-
110
- <span class="note title readonly">readonly</span>
111
-
112
-
113
-
114
-
115
-
116
-
117
-
118
-
119
- <span class="summary_desc"><div class='inline'><p>
120
- Returns the value of attribute content.
121
- </p>
122
- </div></span>
123
-
124
- </li>
125
-
126
-
127
- <li class="public ">
128
- <span class="summary_signature">
129
-
130
- <a href="#type-instance_method" title="#type (instance method)">- (Object) <strong>type</strong> </a>
131
-
132
-
133
-
134
- </span>
135
-
136
-
137
- <span class="note title readonly">readonly</span>
138
-
139
-
140
-
141
-
142
-
143
-
144
-
145
-
146
- <span class="summary_desc"><div class='inline'><p>
147
- Returns the value of attribute type.
148
- </p>
149
- </div></span>
150
-
151
- </li>
152
-
153
-
154
- </ul>
155
-
156
-
157
-
158
-
159
-
160
- <h2>
161
- Instance Method Summary
162
- <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
163
- </h2>
164
-
165
- <ul class="summary">
166
-
167
- <li class="public ">
168
- <span class="summary_signature">
169
-
170
- <a href="#guess_event-instance_method" title="#guess_event (instance method)">- (Object) <strong>guess_event</strong>(status) </a>
171
-
172
-
173
-
174
- </span>
175
-
176
-
177
-
178
-
179
-
180
-
181
-
182
-
183
- <span class="summary_desc"><div class='inline'></div></span>
184
-
185
- </li>
186
-
187
-
188
- <li class="public ">
189
- <span class="summary_signature">
190
-
191
- <a href="#initialize-instance_method" title="#initialize (instance method)">- (StreamEvent) <strong>initialize</strong>(status) </a>
192
-
193
-
194
-
195
- </span>
196
-
197
- <span class="note title constructor">constructor</span>
198
-
199
-
200
-
201
-
202
-
203
-
204
-
205
-
206
- <span class="summary_desc"><div class='inline'><p>
207
- A new instance of StreamEvent.
208
- </p>
209
- </div></span>
210
-
211
- </li>
212
-
213
-
214
- </ul>
215
-
216
-
217
- <div id="constructor_details" class="method_details_list">
218
- <h2>Constructor Details</h2>
219
-
220
- <div class="method_details first">
221
- <p class="signature first" id="initialize-instance_method">
222
-
223
- - (<tt><span class='object_link'><a href="" title="Pupil::Stream::StreamEvent (class)">StreamEvent</a></span></tt>) <strong>initialize</strong>(status)
224
-
225
-
226
-
227
- </p><div class="docstring">
228
- <div class="discussion">
229
- <p>
230
- A new instance of StreamEvent
231
- </p>
232
-
233
-
234
- </div>
235
- </div>
236
- <div class="tags">
237
-
238
-
239
- </div><table class="source_code">
240
- <tr>
241
- <td>
242
- <pre class="lines">
243
-
244
-
245
- 73
246
- 74
247
- 75</pre>
248
- </td>
249
- <td>
250
- <pre class="code"><span class="info file"># File 'lib/pupil/stream/base.rb', line 73</span>
251
-
252
- <span class='kw'>def</span> <span class='id initialize'>initialize</span> <span class='id status'>status</span>
253
- <span class='ivar'>@type</span><span class='comma'>,</span> <span class='ivar'>@content</span> <span class='op'>=</span> <span class='kw'>self</span><span class='period'>.</span><span class='id guess_event'>guess_event</span> <span class='id status'>status</span>
254
- <span class='kw'>end</span></pre>
255
- </td>
256
- </tr>
257
- </table>
258
- </div>
259
-
260
- </div>
261
-
262
- <div id="instance_attr_details" class="attr_details">
263
- <h2>Instance Attribute Details</h2>
264
-
265
-
266
- <span id=""></span>
267
- <span id="content-instance_method"></span>
268
- <div class="method_details first">
269
- <p class="signature first" id="content-instance_method">
270
-
271
- - (<tt>Object</tt>) <strong>content</strong> <span class="extras">(readonly)</span>
272
-
273
-
274
-
275
- </p><div class="docstring">
276
- <div class="discussion">
277
- <p>
278
- Returns the value of attribute content
279
- </p>
280
-
281
-
282
- </div>
283
- </div>
284
- <div class="tags">
285
-
286
-
287
- </div><table class="source_code">
288
- <tr>
289
- <td>
290
- <pre class="lines">
291
-
292
-
293
- 71
294
- 72
295
- 73</pre>
296
- </td>
297
- <td>
298
- <pre class="code"><span class="info file"># File 'lib/pupil/stream/base.rb', line 71</span>
299
-
300
- <span class='kw'>def</span> <span class='id content'>content</span>
301
- <span class='ivar'>@content</span>
302
- <span class='kw'>end</span></pre>
303
- </td>
304
- </tr>
305
- </table>
306
- </div>
307
-
308
-
309
- <span id=""></span>
310
- <span id="type-instance_method"></span>
311
- <div class="method_details ">
312
- <p class="signature " id="type-instance_method">
313
-
314
- - (<tt>Object</tt>) <strong>type</strong> <span class="extras">(readonly)</span>
315
-
316
-
317
-
318
- </p><div class="docstring">
319
- <div class="discussion">
320
- <p>
321
- Returns the value of attribute type
322
- </p>
323
-
324
-
325
- </div>
326
- </div>
327
- <div class="tags">
328
-
329
-
330
- </div><table class="source_code">
331
- <tr>
332
- <td>
333
- <pre class="lines">
334
-
335
-
336
- 70
337
- 71
338
- 72</pre>
339
- </td>
340
- <td>
341
- <pre class="code"><span class="info file"># File 'lib/pupil/stream/base.rb', line 70</span>
342
-
343
- <span class='kw'>def</span> <span class='id type'>type</span>
344
- <span class='ivar'>@type</span>
345
- <span class='kw'>end</span></pre>
346
- </td>
347
- </tr>
348
- </table>
349
- </div>
350
-
351
- </div>
352
-
353
-
354
- <div id="instance_method_details" class="method_details_list">
355
- <h2>Instance Method Details</h2>
356
-
357
-
358
- <div class="method_details first">
359
- <p class="signature first" id="guess_event-instance_method">
360
-
361
- - (<tt>Object</tt>) <strong>guess_event</strong>(status)
362
-
363
-
364
-
365
- </p><table class="source_code">
366
- <tr>
367
- <td>
368
- <pre class="lines">
369
-
370
-
371
- 77
372
- 78
373
- 79
374
- 80
375
- 81
376
- 82
377
- 83
378
- 84
379
- 85
380
- 86
381
- 87
382
- 88
383
- 89
384
- 90
385
- 91</pre>
386
- </td>
387
- <td>
388
- <pre class="code"><span class="info file"># File 'lib/pupil/stream/base.rb', line 77</span>
389
-
390
- <span class='kw'>def</span> <span class='id guess_event'>guess_event</span> <span class='id status'>status</span>
391
- <span class='kw'>if</span> <span class='id status'>status</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>delete</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span>
392
- <span class='kw'>return</span> <span class='symbol'>:delete</span><span class='comma'>,</span> <span class='id status'>status</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>delete</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'>status</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span>
393
- <span class='kw'>elsif</span> <span class='id status'>status</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>friends</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span>
394
- <span class='kw'>return</span> <span class='symbol'>:friends</span><span class='comma'>,</span> <span class='id status'>status</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>friends</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span>
395
- <span class='kw'>elsif</span> <span class='id status'>status</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>event</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span> <span class='op'>==</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>favorite</span><span class='tstring_end'>&quot;</span></span>
396
- <span class='kw'>return</span> <span class='symbol'>:favorite</span><span class='comma'>,</span> <span class='id status'>status</span>
397
- <span class='kw'>elsif</span> <span class='id status'>status</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>retweeted_status</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span>
398
- <span class='kw'>return</span> <span class='symbol'>:retweet</span><span class='comma'>,</span> <span class='id status'>status</span>
399
- <span class='kw'>elsif</span> <span class='id status'>status</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>text</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span>
400
- <span class='kw'>return</span> <span class='symbol'>:status</span><span class='comma'>,</span> <span class='id status'>status</span><span class='comment'>#Pupil::Status.new(status)
401
- </span> <span class='kw'>else</span>
402
- <span class='kw'>return</span> <span class='symbol'>:unknown</span><span class='comma'>,</span> <span class='id status'>status</span>
403
- <span class='kw'>end</span>
404
- <span class='kw'>end</span></pre>
405
- </td>
406
- </tr>
407
- </table>
408
- </div>
409
-
410
- </div>
411
-
412
- </div>
413
-
414
- <div id="footer">
415
- Generated on Fri Dec 16 17:19:17 2011 by
416
- <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
417
- 0.7.3 (ruby-1.9.2).
418
- </div>
419
-
420
- </body>
421
- </html>