Class: Twterm::Tab::Users::Friends
- Inherits:
-
AbstractUsersTab
- Object
- AbstractTab
- AbstractUsersTab
- Twterm::Tab::Users::Friends
- Includes:
- Dumpable
- Defined in:
- lib/twterm/tab/users/friends.rb
Instance Attribute Summary collapse
-
#user_id ⇒ Object
readonly
Returns the value of attribute user_id.
Attributes inherited from AbstractUsersTab
Attributes inherited from AbstractTab
Instance Method Summary collapse
- #dump ⇒ Object
- #fetch ⇒ Object
-
#initialize(app, client, user_id) ⇒ Friends
constructor
A new instance of Friends.
- #title ⇒ Object
Methods included from Dumpable
Methods inherited from AbstractUsersTab
#drawable_item_count, #items, #matches?, #respond_to_key
Methods included from Searchable
Methods included from Scrollable
Methods included from Loadable
#initially_loaded!, #initially_loaded?
Methods inherited from AbstractTab
#==, #close, #find_or_fetch_list, #find_or_fetch_status, #find_or_fetch_user, #render, #respond_to_key
Methods included from Subscriber
included, #subscribe, #unsubscribe
Constructor Details
#initialize(app, client, user_id) ⇒ Friends
Returns a new instance of Friends.
22 23 24 25 26 27 28 29 30 31 |
# File 'lib/twterm/tab/users/friends.rb', line 22 def initialize(app, client, user_id) super(app, client) @user_id = user_id fetch.then do initially_loaded! move_to_top end end |
Instance Attribute Details
#user_id ⇒ Object (readonly)
Returns the value of attribute user_id.
9 10 11 |
# File 'lib/twterm/tab/users/friends.rb', line 9 def user_id @user_id end |
Instance Method Details
#dump ⇒ Object
11 12 13 |
# File 'lib/twterm/tab/users/friends.rb', line 11 def dump user_id end |
#fetch ⇒ Object
15 16 17 18 19 20 |
# File 'lib/twterm/tab/users/friends.rb', line 15 def fetch client.friends(user_id) do |users| @user_ids.concat(users.map(&:id)).uniq! render end end |
#title ⇒ Object
33 34 35 |
# File 'lib/twterm/tab/users/friends.rb', line 33 def title user.nil? ? 'Loading...' : "@#{user.screen_name} following" end |