Class: TweetApi
- Inherits:
-
Object
- Object
- TweetApi
- Defined in:
- lib/tweetgem.rb
Instance Attribute Summary collapse
-
#me ⇒ Object
readonly
Returns the value of attribute me.
-
#newest_followers ⇒ Object
readonly
Returns the value of attribute newest_followers.
-
#newest_friends ⇒ Object
readonly
Returns the value of attribute newest_friends.
Instance Method Summary collapse
- #global_trend ⇒ Object
-
#initialize(username, token = nil) ⇒ TweetApi
constructor
A new instance of TweetApi.
- #lists(username = nil, ownership_first = false) ⇒ Object
- #lists_owner(username = nil, count = 30) ⇒ Object
- #lists_subscription(username = nil, count = 30) ⇒ Object
Constructor Details
#initialize(username, token = nil) ⇒ TweetApi
Returns a new instance of TweetApi.
7 8 9 10 11 12 13 14 |
# File 'lib/tweetgem.rb', line 7 def initialize(username,token = nil) token ||= AppAuth::init @bearer = token @me = AppAuth::user_show(@bearer,username) @screen_name = username @newest_followers = AppAuth::user_newest_followers(@bearer,username) @newest_friends = AppAuth::user_newest_friends(@bearer,username) end |
Instance Attribute Details
#me ⇒ Object (readonly)
Returns the value of attribute me.
5 6 7 |
# File 'lib/tweetgem.rb', line 5 def me @me end |
#newest_followers ⇒ Object (readonly)
Returns the value of attribute newest_followers.
5 6 7 |
# File 'lib/tweetgem.rb', line 5 def newest_followers @newest_followers end |
#newest_friends ⇒ Object (readonly)
Returns the value of attribute newest_friends.
5 6 7 |
# File 'lib/tweetgem.rb', line 5 def newest_friends @newest_friends end |
Instance Method Details
#global_trend ⇒ Object
31 32 33 |
# File 'lib/tweetgem.rb', line 31 def global_trend() return AppAuth::global_trend(@bearer) end |
#lists(username = nil, ownership_first = false) ⇒ Object
16 17 18 19 |
# File 'lib/tweetgem.rb', line 16 def lists(username = nil,ownership_first = false) username ||= @screen_name return AppAuth::lists(@bearer,username,ownership_first) end |
#lists_owner(username = nil, count = 30) ⇒ Object
21 22 23 24 |
# File 'lib/tweetgem.rb', line 21 def lists_owner(username = nil,count = 30) username ||= @screen_name return AppAuth::lists_owner(@bearer,username,count) end |
#lists_subscription(username = nil, count = 30) ⇒ Object
26 27 28 29 |
# File 'lib/tweetgem.rb', line 26 def lists_subscription(username = nil,count = 30) username ||= @screen_name return AppAuth::lists_subscription(@bearer,username,count) end |