Class: Twterm::Tab::Statuses::Mentions

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

Instance Attribute Summary

Attributes inherited from AbstractTab

#window

Instance Method Summary collapse

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 Utils

check_type

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

Returns a new instance of Mentions.



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

def initialize(app, client)
  fail ArgumentError, 'argument must be an instance of Client class' unless client.is_a? Client

  super(app, client)

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

  reload.then do |statuses|
    initially_loaded!
    statuses.each { |s| append(s) }
    scroller.move_to_top
  end

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

Instance Method Details

#closeObject



10
11
12
# File 'lib/twterm/tab/statuses/mentions.rb', line 10

def close
  fail NotClosableError
end

#fetchObject



14
15
16
# File 'lib/twterm/tab/statuses/mentions.rb', line 14

def fetch
  client.mentions
end

#titleObject



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

def title
  'Mentions'.freeze
end