Class: Twterm::Tab::Statuses::UserTimeline
- Inherits:
-
AbstractStatusesTab
- Object
- AbstractTab
- AbstractStatusesTab
- Twterm::Tab::Statuses::UserTimeline
- Defined in:
- lib/twterm/tab/statuses/user_timeline.rb
Instance Attribute Summary collapse
-
#user ⇒ Object
readonly
Returns the value of attribute user.
-
#user_id ⇒ Object
readonly
Returns the value of attribute user_id.
Attributes inherited from AbstractTab
Instance Method Summary collapse
- #==(other) ⇒ Object
- #close ⇒ Object
- #dump ⇒ Object
- #fetch ⇒ Object
-
#initialize(app, client, user_id) ⇒ UserTimeline
constructor
A new instance of UserTimeline.
- #title ⇒ Object
Methods included from Dumpable
Methods included from Cacheable
Methods inherited from AbstractStatusesTab
#append, #delete, #destroy_status, #drawable_item_count, #favorite, #items, #matches?, #open_link, #prepend, #quote, #reply, #respond_to_key, #retweet, #show_conversation, #show_user, #statuses, #total_item_count
Methods included from Utils
Methods included from Loadable
#initially_loaded!, #initially_loaded?
Methods included from Subscriber
included, #subscribe, #unsubscribe
Methods included from Twterm::Tab::Searchable
Methods included from Twterm::Tab::Scrollable
Methods included from Publisher
Methods inherited from AbstractTab
#find_or_fetch_list, #find_or_fetch_status, #find_or_fetch_user, #render, #respond_to_key
Constructor Details
#initialize(app, client, user_id) ⇒ UserTimeline
Returns a new instance of UserTimeline.
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/twterm/tab/statuses/user_timeline.rb', line 30 def initialize(app, client, user_id) super(app, client) @user_id = user_id @auto_reloader = Scheduler.new(120) { reload } retrieve_from_cache! find_or_fetch_user(user_id).then do |user| @user = user app.tab_manager.refresh_window reload.then do initially_loaded! scroller.move_to_top end end end |
Instance Attribute Details
#user ⇒ Object (readonly)
Returns the value of attribute user.
11 12 13 |
# File 'lib/twterm/tab/statuses/user_timeline.rb', line 11 def user @user end |
#user_id ⇒ Object (readonly)
Returns the value of attribute user_id.
11 12 13 |
# File 'lib/twterm/tab/statuses/user_timeline.rb', line 11 def user_id @user_id end |
Instance Method Details
#==(other) ⇒ Object
13 14 15 |
# File 'lib/twterm/tab/statuses/user_timeline.rb', line 13 def ==(other) other.is_a?(self.class) && user_id == other.user_id end |
#close ⇒ Object
17 18 19 20 |
# File 'lib/twterm/tab/statuses/user_timeline.rb', line 17 def close @auto_reloader.kill if @auto_reloader super end |
#dump ⇒ Object
22 23 24 |
# File 'lib/twterm/tab/statuses/user_timeline.rb', line 22 def dump @user.id end |
#fetch ⇒ Object
26 27 28 |
# File 'lib/twterm/tab/statuses/user_timeline.rb', line 26 def fetch client.user_timeline(@user.id) end |
#title ⇒ Object
49 50 51 |
# File 'lib/twterm/tab/statuses/user_timeline.rb', line 49 def title @user.nil? ? 'Loading...' : "@#{@user.screen_name} timeline" end |