Class: Twterm::Tab::Statuses::Home

Inherits:
AbstractStatusesTab show all
Includes:
Subscriber, Utils
Defined in:
lib/twterm/tab/statuses/home.rb

Instance Attribute Summary

Attributes inherited from AbstractTab

#window

Instance Method Summary collapse

Methods included from Utils

check_type

Methods included from Subscriber

included, #subscribe, #unsubscribe

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 Loadable

#initially_loaded!, #initially_loaded?

Methods included from Twterm::Tab::Searchable

#matches?

Methods included from Twterm::Tab::Scrollable

#scroller, #total_item_count

Methods included from Publisher

#publish

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) ⇒ Home

Returns a new instance of Home.



21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/twterm/tab/statuses/home.rb', line 21

def initialize(app, client)
  super(app, client)

  subscribe(Event::Status::Timeline) { |e| prepend(e.status) }

  reload.then do
    initially_loaded!
    scroller.move_to_top
  end

  @auto_reloader = Scheduler.new(180) { reload }
end

Instance Method Details

#closeObject



13
14
15
# File 'lib/twterm/tab/statuses/home.rb', line 13

def close
  fail NotClosableError
end

#fetchObject



17
18
19
# File 'lib/twterm/tab/statuses/home.rb', line 17

def fetch
  client.home_timeline
end

#titleObject



34
35
36
# File 'lib/twterm/tab/statuses/home.rb', line 34

def title
  'Home'.freeze
end