Class: Twterm::Tab::Statuses::Home
- Inherits:
-
Object
- Object
- Twterm::Tab::Statuses::Home
- Includes:
- Base
- Defined in:
- lib/twterm/tab/statuses/home.rb
Instance Attribute Summary
Attributes included from Twterm::Tab::Scrollable
Attributes included from Base
Instance Method Summary collapse
- #close ⇒ Object
- #fetch ⇒ Object
-
#initialize(client) ⇒ Home
constructor
A new instance of Home.
- #title ⇒ Object
Methods included from Base
#append, #delete, #destroy_status, #drawable_item_count, #favorite, #items, #open_link, #prepend, #reply, #respond_to_key, #retweet, #show_conversation, #show_user, #statuses, #total_item_count, #touch_statuses, #update
Methods included from Twterm::Tab::Scrollable
Methods included from FilterableList
#filter, #filter_query, #items, #reset_filter
Methods included from Base
#==, #refresh, #resize, #respond_to_key
Constructor Details
#initialize(client) ⇒ Home
Returns a new instance of Home.
19 20 21 22 23 24 25 26 27 28 |
# File 'lib/twterm/tab/statuses/home.rb', line 19 def initialize(client) fail ArgumentError, 'argument must be an instance of Client class' unless client.is_a? Client super() @client = client @client.on_timeline_status(&method(:prepend)) fetch { scroller.move_to_top } @auto_reloader = Scheduler.new(180) { fetch } end |
Instance Method Details
#close ⇒ Object
7 8 9 |
# File 'lib/twterm/tab/statuses/home.rb', line 7 def close fail NotClosableError end |
#fetch ⇒ Object
11 12 13 14 15 16 17 |
# File 'lib/twterm/tab/statuses/home.rb', line 11 def fetch @client.home_timeline.then do |statuses| statuses.each(&method(:prepend)) sort yield if block_given? end end |
#title ⇒ Object
30 31 32 |
# File 'lib/twterm/tab/statuses/home.rb', line 30 def title 'Home'.freeze end |