Class: Twterm::Tab::Users::Friends
- Inherits:
-
Object
- Object
- Twterm::Tab::Users::Friends
- Defined in:
- lib/twterm/tab/users/friends.rb
Instance Attribute Summary collapse
-
#user_id ⇒ Object
readonly
Returns the value of attribute user_id.
Attributes included from Base
Attributes included from Scrollable
Attributes included from Base
Instance Method Summary collapse
- #dump ⇒ Object
- #fetch ⇒ Object
-
#initialize(user_id) ⇒ Friends
constructor
A new instance of Friends.
- #title ⇒ Object
Methods included from Dumpable
Methods included from Base
#close, #drawable_item_count, #items, #respond_to_key
Methods included from Scrollable
Methods included from FilterableList
#filter, #filter_query, #items, #reset_filter
Methods included from Base
#==, #close, #refresh, #resize, #respond_to_key
Constructor Details
#initialize(user_id) ⇒ Friends
Returns a new instance of Friends.
21 22 23 24 25 26 27 |
# File 'lib/twterm/tab/users/friends.rb', line 21 def initialize(user_id) super() @user_id = user_id fetch { move_to_top } end |
Instance Attribute Details
#user_id ⇒ Object (readonly)
Returns the value of attribute user_id.
8 9 10 |
# File 'lib/twterm/tab/users/friends.rb', line 8 def user_id @user_id end |
Instance Method Details
#dump ⇒ Object
10 11 12 |
# File 'lib/twterm/tab/users/friends.rb', line 10 def dump user_id end |
#fetch ⇒ Object
14 15 16 17 18 19 |
# File 'lib/twterm/tab/users/friends.rb', line 14 def fetch Client.current.friends(user_id) do |users| @user_ids.concat(users.map(&:id)).uniq! refresh end end |
#title ⇒ Object
29 30 31 |
# File 'lib/twterm/tab/users/friends.rb', line 29 def title user.nil? ? 'Loading...' : "@#{user.screen_name} following" end |